Posts

Showing posts from January, 2017
some url/category/action_within_category create an instance of the category controller and then calls the action with that instance looks for template to display the action and result heading to /views/say and seeing if it finds a specific template for that action
Model - persistent data business logic CART USER LINE_ITEM PRODUCT. RELATIONSHPS BETWEEN THE MODEL OBJs has_many or belongs_to like line_items belong to a cart and a cart has_many products/line_items  models have attributes  data validations VIEW presenting yourself, default edit, new, form, index, show helpers for view behavior keeping views slim ATOM CONTROLLER Find and fetch data  put data in instance vars callback actions CONCERN - common controller logic GET - new, index, show, edit POST - create PUT - update DELETE - destroy ACTIVE RECORD: maps  CRUD many_to_many - has_and_belongs_to one_to_many one_to_one scope :last_n_days, lambda {|days| where('updated < ?', days)}    then you call it with orders = Order.last_n_days(7) create, create!, save, save!    ! always sends back an exception in create vs create! you may not know if it truly was written unless use ! Defining your data, locating and ...