Repository files navigation Live Lecture - Rails Models and ReSTful Routing
Make a migration for products table
name, category, price, sku_number, availability
Make a model
associations (for when we will build more than one model)
validations
custom methods
Create routes
Build index page
Build Show page
Build all routes
Build new/create actions
Build new form
Build edit/update actions
Build edit form
Build destroy action
Delete form
Add built-in validations
Add logic for displaying error messages in new/edit forms
Add style to stylesheets for error messages
Add custom validations with separate class TwoWordsValidator
Add an index and the uniqueness constraint directly to the name column in the products table
General conversation about race conditions
Review how the .new method works and what methods are actually being called behind the scenes.
Implement a nested form for a belongs_to relationship
Optionally allow a user to choose from a brand that already exists or create a new brand
Implement a nested form for a has_many relationship
Understand the methods provided by the accepts_nested_attributes_for macro
Create custom attribute writers and understand why/when they are useful
Week 4 (Partials, Layout, Helpers)
Introduction on refactoring in Rails: the process and the layers
Talk about layouts and build new brands.html.erb and products.html.erb
Discuss about partials and abstract reused code into new partial files
Introduce helpers and create new methods to remove logic from the views
Week 5 (Nested Routes, N+1 queries, Search Form)
Add extra nested and non-nested routes
Adjust existing files to support both types of routes
Discuss N+1 queries and the differences between count/size/length
Implement a search form with form_with and use scope method to query the db
Week 6 (Authentication and Omniauth)
Implement regular authentication: add routes, user model, bcrypt, SessionsController, UsersController, view files
Include third-party oauth with omniauth
Use env variables and implement each strategy
You can’t perform that action at this time.