Matestack Ui Bootstrap
AboutMatestack Ui CoreMatestack Ui VueJsMatestack Ui Bootstrap
2.1
2.1
  • Welcome
  • Getting Started
    • Installation & Update
    • Quick Start [WIP]
  • API
    • Templates
      • Apps
        • Admin App Template
    • Form
      • Checkbox
      • Input
      • Radio
      • Select
      • Submit
      • Switch
    • Components
      • Accordion
      • Alert
      • Badge
      • Breadcrumb
      • Button
      • ButtonGroup
      • Card
      • Carousel
      • Chart
      • Close
      • Collapse
      • Dropdown
      • ListGroup
      • Modal
      • Nav
      • Navbar
      • Pagination
      • Popover
      • Progress
      • Scrollspy
      • Smart collection
      • Spinner
      • Toast
      • Tooltip
    • Layout
      • Container
      • Col
      • Row
  • Integrations
    • Chart.js
    • Flatpickr
    • Devise
Powered by GitBook
On this page
  1. Integrations

Devise

Please review the general guide on how to integrate Devise into Matestack within the docs of matestack-ui-core.

Below you find examples implementing typical Devise views with matestack-ui-bootstrap

Login Page

class Devise::Pages::SignIn < Matestack::Ui::Page

  def response
    bs_container class: "mt-5" do
      bs_row class: "mt-5", vertical: :center, horizontal: :center do
        bs_col md:4 do
          login_form_partial
        end
      end
    end
  end

  private

    def login_form_partial
      section class: "mt-5 rounded shadow-sm p-4 mb-4" do
        heading size: 2, text: 'Sign in'
        matestack_form form_config do
          div class: "mb-3 mt-4" do
            bs_form_input label: 'Email', key: :email, type: :email
          end
          div class: "mb-3" do
            bs_form_input label: 'Password', key: :password, type: :password
          end
          div class: "mb-3" do
            bs_form_submit text: "Sign in"
          end
        end
        toggle show_on: 'sign_in_failure' do
          plain 'Your email or password is not valid.'
        end
      end
    end

    def form_config
      {
        for: :admin,
        method: :post,
        path: admin_session_path,
        delay: 500,
        success: {
          redirect: {
            follow_response: true
          }
        },
        failure: {
          emit: 'sign_in_failure'
        }
      }
    end

end
PreviousFlatpickr

Last updated 3 years ago