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