Guest User

Untitled

a guest
Jan 16th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. TIL...
  2. 1.) Web request cycle
  3. ▼ ▼ ▼ ▼ STEPS ▼ ▼ ▼ ▼
  4. ---------------------
  5. 1. WEB REQUEST
  6. 2. API ROUTE
  7. 3. API CONTROLLER (gets data from MODEL)
  8. - Here you have the option to duck out and either store or retrieve data in a database.
  9. 4. JSON VIEW
  10. 5. WEB RESPONSE
  11. 2.) a 'model' is made up of 2 parts: a Ruby Class (methods of the model) and a Database Table (Attributes of the model).
  12. 3.) CRUD! Create Read Update Destroy! The 4 things you can do with a piece of data.
  13. 4.) object.find_by(class.attribute)
  14. 5.) If you rails db:migrate, if it gives error or blows up, the db has not been effected. Fix error and run again.
  15. 6.) MVC - Model View Controller.
  16. Model - Defines how we interact with stored information
  17. View - Defines interface
  18. Controller - The logical flow
Add Comment
Please, Sign In to add comment