Advertisement
solidsnake

12/3

Dec 2nd, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.57 KB | None | 0 0
  1. App
  2. ---
  3. -driver
  4. -credentials
  5. -logic
  6.  
  7. changing db does not change codebase; abstraction layer will be the one accessed by the application
  8.  
  9. ORM - Object Relational Mapping
  10.  
  11. active record - library used by rails to perform object relational operations
  12.  
  13. 1. how do we represent the table?
  14. 2. how do we represent fields?
  15. 3. how do we implement logic?
  16.  
  17. rails generate model Person first_name:string last_name:string contact_number:string
  18.  
  19. rake db:migrate
  20.  
  21. rails console
  22.  
  23. PagesController
  24.  
  25. <td>
  26.  
  27. <% @people.each do |p| %>
  28. <% end %>
  29.  
  30. @person = Person.find(params[:id])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement