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

1
class Devise::Pages::SignIn < Matestack::Ui::Page
2
3
def response
4
bs_container class: "mt-5" do
5
bs_row class: "mt-5", vertical: :center, horizontal: :center do
6
bs_col md:4 do
7
login_form_partial
8
end
9
end
10
end
11
end
12
13
private
14
15
def login_form_partial
16
section class: "mt-5 rounded shadow-sm p-4 mb-4" do
17
heading size: 2, text: 'Sign in'
18
matestack_form form_config do
19
div class: "mb-3 mt-4" do
20
bs_form_input label: 'Email', key: :email, type: :email
21
end
22
div class: "mb-3" do
23
bs_form_input label: 'Password', key: :password, type: :password
24
end
25
div class: "mb-3" do
26
bs_form_submit text: "Sign in"
27
end
28
end
29
toggle show_on: 'sign_in_failure' do
30
plain 'Your email or password is not valid.'
31
end
32
end
33
end
34
35
def form_config
36
{
37
for: :admin,
38
method: :post,
39
path: admin_session_path,
40
delay: 500,
41
success: {
42
redirect: {
43
follow_response: true
44
}
45
},
46
failure: {
47
emit: 'sign_in_failure'
48
}
49
}
50
end
51
52
end
Copied!
Copy link
Contents
Login Page