edit.html.erb 1.6 KB

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