Module: LiveFront::SignInFormHelper

Defined in:
lib/live-front/sign_in_form_helper.rb

Instance Method Summary collapse

Instance Method Details

#sign_in_form_for(model, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/live-front/sign_in_form_helper.rb', line 3

def (model, options = {})
  klass = options.delete(:class)
  options.merge!(html: { class: ['basic-sign-in-form', klass].compact.join(' ') })

  form_for model, options do |f|
    [
      (:h3, I18n.t('sign_in_form.heading'), class: 'sign-in-form-heading'),
      f.email_field(:email, class: 'form-control', placeholder: I18n.t('sign_in_form.form.email'), autofocus: true),
      f.password_field(:password, class: 'form-control', placeholder: I18n.t('sign_in_form.form.password')),
      f.submit(I18n.t('sign_in_form.form.submit'), class: 'btn btn-primary btn-block')
    ].join('').html_safe
  end
end