edit.html.haml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. %h2
  2. Edit #{resource_name.to_s.humanize}
  3. = form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
  4. = devise_error_messages!
  5. .field
  6. = f.label :username
  7. %br/
  8. = f.email_field :username, autofocus: true, autocomplete: "username"
  9. .field
  10. = f.label :email
  11. %br/
  12. = f.email_field :email, autocomplete: "email"
  13. - if devise_mapping.confirmable? && resource.pending_reconfirmation?
  14. %div
  15. Currently waiting confirmation for: #{resource.unconfirmed_email}
  16. .field
  17. = f.label :password
  18. %i (leave blank if you don't want to change it)
  19. %br/
  20. = f.password_field :password, autocomplete: "new-password"
  21. - if @minimum_password_length
  22. %br/
  23. %em
  24. = @minimum_password_length
  25. characters minimum
  26. .field
  27. = f.label :password_confirmation
  28. %br/
  29. = f.password_field :password_confirmation, autocomplete: "new-password"
  30. .field
  31. = f.label :current_password
  32. %i (we need your current password to confirm your changes)
  33. %br/
  34. = f.password_field :current_password, autocomplete: "current-password"
  35. .actions
  36. = f.submit "Update"
  37. %h3 Cancel my account
  38. %p
  39. Unhappy? #{button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete}
  40. = link_to "Back", :back