Module: MinimalistAuthentication::ApplicationHelper
- Defined in:
- app/helpers/minimalist_authentication/application_helper.rb
Instance Method Summary collapse
- #ma_confirm_password_field(form, options = {}) ⇒ Object
- #ma_email_field(form, options = {}) ⇒ Object
- #ma_forgot_password_link ⇒ Object
- #ma_new_password_field(form, options = {}) ⇒ Object
- #ma_password_field(form, options = {}) ⇒ Object
- #ma_username_field(form, options = {}) ⇒ Object
Instance Method Details
#ma_confirm_password_field(form, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 5 def ma_confirm_password_field(form, = {}) form.password_field( :password_confirmation, .reverse_merge( autocomplete: "new-password", minlength: MinimalistAuthentication.user_model.password_minimum, placeholder: t(".password_confirmation.placeholder"), required: true ) ) end |
#ma_email_field(form, options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 17 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_forgot_password_link ⇒ Object
29 30 31 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 29 def ma_forgot_password_link link_to(t(".forgot_password"), new_password_reset_path) end |
#ma_new_password_field(form, options = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 33 def ma_new_password_field(form, = {}) form.password_field( :password, .reverse_merge( autocomplete: "new-password", minlength: MinimalistAuthentication.user_model.password_minimum, placeholder: t(".password.placeholder"), required: true ) ) end |
#ma_password_field(form, options = {}) ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 45 def ma_password_field(form, = {}) form.password_field( :password, .reverse_merge( autocomplete: "current-password", placeholder: true, required: true ) ) end |
#ma_username_field(form, options = {}) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 |
# File 'app/helpers/minimalist_authentication/application_helper.rb', line 56 def ma_username_field(form, = {}) form.text_field( :username, .reverse_merge( autocomplete: "username", autofocus: true, placeholder: true, required: true ) ) end |