Module: MinimalistAuthentication::ApplicationHelper
- Defined in:
- app/helpers/minimalist_authentication/application_helper.rb
Instance Method Summary collapse
- #ma_change_email_link ⇒ Object
- #ma_confirm_password_field(form, options = {}) ⇒ Object
- #ma_email_field(form, options = {}) ⇒ Object
- #ma_email_verification_button ⇒ Object
- #ma_forgot_password_link ⇒ Object
- #ma_new_password_field(form, options = {}) ⇒ Object
- #ma_password_field(form, options = {}) ⇒ Object
- #ma_skip_link ⇒ Object
- #ma_username_field(form, options = {}) ⇒ Object
- #ma_verification_message(user = current_user) ⇒ Object
Instance Method Details
#ma_change_email_link ⇒ Object
5 6 7 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 5 def ma_change_email_link link_to("Change", edit_email_path) end |
#ma_confirm_password_field(form, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 9 def ma_confirm_password_field(form, = {}) form.password_field( :password_confirmation, .reverse_merge( autocomplete: "new-password", minlength: MinimalistAuthentication.user_model.password_minimum, placeholder: true, required: true ) ) end |
#ma_email_field(form, options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 21 def ma_email_field(form, = {}) form.email_field( :email, .reverse_merge( autocomplete: "email", autofocus: true, placeholder: t(".email.placeholder", default: true), required: true ) ) end |
#ma_email_verification_button ⇒ Object
33 34 35 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 33 def (**) (t(".button"), email_verification_path, **) end |
#ma_forgot_password_link ⇒ Object
37 38 39 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 37 def ma_forgot_password_link link_to(t(".forgot_password"), new_password_reset_path) end |
#ma_new_password_field(form, options = {}) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 41 def ma_new_password_field(form, = {}) form.password_field( :password, .reverse_merge( autocomplete: "new-password", minlength: MinimalistAuthentication.user_model.password_minimum, placeholder: "New password", required: true ) ) end |
#ma_password_field(form, options = {}) ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 53 def ma_password_field(form, = {}) form.password_field( :password, .reverse_merge( autocomplete: "current-password", placeholder: true, required: true ) ) end |
#ma_skip_link ⇒ Object
64 65 66 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 64 def ma_skip_link link_to("Skip", login_redirect_to) end |
#ma_username_field(form, options = {}) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 68 def ma_username_field(form, = {}) form.text_field( :username, .reverse_merge( autocomplete: "username", autofocus: true, placeholder: true, required: true ) ) end |
#ma_verification_message(user = current_user) ⇒ Object
80 81 82 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 80 def (user = current_user) render(user.email_verified? ? "verified" : "unverified") end |