Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. acts_as_authentic
  2.  
  3. <h1>Listing users</h1>
  4.  
  5. <table>
  6. <tr>
  7. <th>Username</th>
  8. <th>Email</th>
  9. <th></th>
  10. <th></th>
  11. <th></th>
  12. </tr>
  13.  
  14. <% @users.each do |user| %>
  15. <tr>
  16. <td><%= user.username %></td>
  17. <td><%= user.email %></td>
  18. <td><%= link_to 'Show', user %></td>
  19. <td><%= link_to 'Edit', edit_user_path(user) %></td>
  20. <td><%= link_to 'Destroy', user, :confirm => 'Are you sure?', :method => :delete %></td>
  21. </tr>
  22. <% end %>
  23. </table>
  24.  
  25. <br />
  26.  
  27. <%= link_to 'New User', new_user_path %>
  28.  
  29. <%= form_for(@user) do |f| %>
  30. <% if @user.errors.any? %>
  31. <div id="error_explanation">
  32. <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
  33.  
  34. <ul>
  35. <% @user.errors.full_messages.each do |msg| %>
  36. <li><%= msg %></li>
  37. <% end %>
  38. </ul>
  39. </div>
  40. <% end %>
  41.  
  42. <div class="field">
  43. <%= f.label :username %><br />
  44. <%= f.text_field :username %>
  45. </div>
  46. <div class="field">
  47. <%= f.label :email %><br />
  48. <%= f.text_field :email %>
  49. </div>
  50. <div class="field">
  51. <%= f.label :password %><br />
  52. <%= f.password_field :password %>
  53. </div>
  54. <div class="field">
  55. <%= f.label :password_confirmation %><br />
  56. <%= f.password_field :password_confirmation %>
  57. </div>
  58. <div class="actions">
  59. <%= f.submit %>
  60. </div>
  61. <% end %>
  62.  
  63. -Password is too short (minimum is 4 characters)
  64. -Password confirmation is too short (minimum is 4 characters)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement