edit.html.erb 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <div class='container'>
  2. <div class='row'>
  3. <div class='col-md-8 col-md-offset-2'>
  4. <div class='well'>
  5. <h2>Edit <%= resource_name.to_s.humanize %></h2>
  6. <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'form-horizontal' }) do |f| %>
  7. <%= devise_error_messages! %>
  8. <div class="form-group">
  9. <%= f.label :email, class: 'col-md-4 control-label' %>
  10. <div class="col-md-6">
  11. <%= f.email_field :email, autofocus: true, class: 'form-control' %>
  12. </div>
  13. </div>
  14. <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
  15. <div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
  16. <% end %>
  17. <div class="form-group">
  18. <%= f.label :username, class: 'col-md-4 control-label' %>
  19. <div class="col-md-6">
  20. <%= f.text_field :username, class: 'form-control' %>
  21. </div>
  22. </div>
  23. <div class="form-group">
  24. <%= f.label :current_password, class: 'col-md-4 control-label' %>
  25. <div class="col-md-6">
  26. <%= f.password_field :current_password, class: 'form-control' %>
  27. <span class='help-inline'>We need your current password to confirm your changes.</span>
  28. </div>
  29. </div>
  30. <div class="form-group">
  31. <div class="col-md-offset-4 col-md-10">
  32. <%= f.submit "Update", class: "btn btn-primary" %>
  33. </div>
  34. </div>
  35. <% end %>
  36. <h3>Change password</h3>
  37. <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'form-horizontal' }) do |f| %>
  38. <%= devise_error_messages! %>
  39. <div class="form-group">
  40. <%= f.label :current_password, class: 'col-md-4 control-label' %>
  41. <div class="col-md-6">
  42. <%= f.password_field :current_password, class: 'form-control' %>
  43. <span class='help-inline'>We need your current password to confirm your changes.</span>
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <%= f.label :password, class: 'col-md-4 control-label' %>
  48. <div class="col-md-6">
  49. <%= f.password_field :password, autocomplete: "off", class: 'form-control' %>
  50. </div>
  51. </div>
  52. <div class="form-group">
  53. <%= f.label :password_confirmation, class: 'col-md-4 control-label' %>
  54. <div class="col-md-6">
  55. <%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control' %>
  56. </div>
  57. </div>
  58. <div class="form-group">
  59. <div class="col-md-offset-4 col-md-10">
  60. <%= f.submit "Update", class: "btn btn-primary" %>
  61. </div>
  62. </div>
  63. <% end %>
  64. <hr>
  65. <h3>Cancel my account</h3>
  66. <p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
  67. <%= link_to "Back", :back %>
  68. </div>
  69. </div>
  70. </div>
  71. </div>