class Chapter < ActiveRecord::Base
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Do not forget to automatically `touch` parent object from associations
belongs_to :book, touch: true
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
end
after_touch() { tire.update_index }
ds = params[:diameter].split(','),
@items = @sub_category.items.where( :size => [ds.first..ds.last])
The require method ensures that a specific parameter is present, and if it's not provided, the require method throws an error. It returns an instance of ActionController::Parameters for the key passed into require.
messege : { author_id:1, destin_id:2, content:3}
create_table :carts_items do |t|
t.references :card
t.references :item
t.decimal :quantity
end