Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. class CreateUsers < ActiveRecord::Migration
  2. def self.up
  3. create_table :users do |t|
  4. t.string :username
  5. t.string :password
  6. t.string :security_number
  7. end
  8. end
  9. def self.down
  10. drop_table :users
  11. end
  12. end
  13.  
  14. <%= form_for(@user) do |f| %>
  15. <% if @user.errors.any? %>
  16. <div id="error_explanation">
  17. <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
  18.  
  19. <ul>
  20. <% @user.errors.full_messages.each do |message| %>
  21. <li><%= message %></li>
  22. <% end %>
  23. </ul>
  24. </div>
  25. <% end %>
  26.  
  27. <div class="actions">
  28. <%= f.submit %>
  29. </div>
  30. <% end %>
  31.  
  32. <div class="field">
  33. <%= f.label :name %>
  34. <%= f.text_field :name %>
  35. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement