candychang/bernal-heights

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

Summary

Maintainability
Test Coverage
%div{:class => "col-md-4"}
  %h2 Edit Account
  
  %h3 Update Personal Information
  = simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
    .form-inputs
      = f.input :name, required: true, autofocus: true, full_error: flash[:alert]
      = f.input :email, required: true, error: flash[:alert]
    .form-actions
      = f.button :submit, "Update"
  
  %h3 Update Password
  = simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
    .form-inputs
      = f.input :password, autocomplete: "off", required: true, error: flash[:alert]
      = f.input :password_confirmation, required: true, error: flash[:alert]
      = f.input :current_password, hint: "We need your current password to confirm your changes", error: "Current password is invalid", required: true
    .form-actions
      = f.button :submit, "Change Password"
  
  = link_to "Back", :back