edit.html.erb 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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, :class => 'form-control' %>
  12. </div>
  13. </div>
  14. <div class="form-group">
  15. <%= f.label :username, :class => 'col-md-4 control-label' %>
  16. <div class="col-md-6">
  17. <%= f.text_field :username, :class => 'form-control' %>
  18. </div>
  19. </div>
  20. <div class="form-group">
  21. <%= f.label :current_password, :class => 'col-md-4 control-label' %>
  22. <div class="col-md-6">
  23. <%= f.password_field :current_password, :class => 'form-control' %>
  24. <span class='help-inline'>We need your current password to confirm your changes.</span>
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <div class="col-md-offset-4 col-md-10">
  29. <%= f.submit "Update", :class => "btn btn-primary" %>
  30. </div>
  31. </div>
  32. <% end %>
  33. <h3>Change password</h3>
  34. <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f| %>
  35. <%= devise_error_messages! %>
  36. <div class="form-group">
  37. <%= f.label :current_password, :class => 'col-md-4 control-label' %>
  38. <div class="col-md-6">
  39. <%= f.password_field :current_password, :class => 'form-control' %>
  40. <span class='help-inline'>We need your current password to confirm your changes.</span>
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <%= f.label :password, :class => 'col-md-4 control-label' %>
  45. <div class="col-md-6">
  46. <%= f.password_field :password, :autocomplete => "off", :class => 'form-control' %>
  47. </div>
  48. </div>
  49. <div class="form-group">
  50. <%= f.label :password_confirmation, :class => 'col-md-4 control-label' %>
  51. <div class="col-md-6">
  52. <%= f.password_field :password_confirmation, :class => 'form-control' %>
  53. </div>
  54. </div>
  55. <div class="form-group">
  56. <div class="col-md-offset-4 col-md-10">
  57. <%= f.submit "Update", :class => "btn btn-primary" %>
  58. </div>
  59. </div>
  60. <% end %>
  61. <hr>
  62. <h3>Cancel my account</h3>
  63. <p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>.</p>
  64. <%= link_to "Back", :back %>
  65. </div>
  66. </div>
  67. </div>
  68. </div>