mberlanda/cheidelacoriera

View on GitHub
app/views/devise/registrations/edit.html.haml

Summary

Maintainability
Test Coverage
- @title = t('devise.registrations.edit', model: resource)

.jumbotron
  = simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
    = f.error_notification
    .form-inputs
      = f.input :first_name, required: true
      = f.input :last_name, required: true
      = f.input :date_of_birth, as: :date, start_year: Time.zone.today.year - 90, end_year: Time.zone.today.year - 12
      = f.input :place_of_birth
      = f.input :phone_number, required: true
      = f.input :email, required: true, autofocus: true
      - if devise_mapping.confirmable? && resource.pending_reconfirmation?
        %p
          Currently waiting confirmation for: #{resource.unconfirmed_email}
      = f.input :password, autocomplete: :off, hint: t('simple_form.hints.edit_password'), required: false
      = f.input :password_confirmation, required: false
      = f.input :current_password, hint: t('simple_form.hints.current_password'), required: true
      = f.input :newsletter
    .form-actions
      = f.button :submit, t('devise.registrations.update')
      = link_to t('devise.registrations.back'), :back, class: 'btn btn-primary'

  %br/
/ %h3 Cancel my account
/ %p
/   Unhappy? #{link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete}
= render partial: 'shared/form_html5_support'