RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: danieldocki
Site: http://danieldocki.com/
How do assets to work with https and http?
me too, I'm using postgres
$ gem list pg *** LOCAL GEMS *** pg (0.14.0)
How I do fix that?
How can I show validation errors?
The creation of the Category I need to pass the establishment_id how can I do this? being that he is not an attribute attr_accessible
class Product < ActiveRecord::Base validates :name, :description, :price, :category_name, presence: true validates :category, associated: true belongs_to :establishment has_one :item_carte has_one :category, through: :item_carte attr_accessible :name, :description, :price, :category_name def category_name category.try(:name) end def category_name=(name) self.category = Category.find_or_create_by_name(name) if name.present? end end
class Category < ActiveRecord::Base validates :name, presence: true validates :name, uniqueness: true validates :products, associated: true belongs_to :establishment has_many :item_cartes has_many :products, through: :item_cartes attr_accessible :name end
How do assets to work with https and http?
me too, I'm using postgres
$ gem list pg
*** LOCAL GEMS ***
pg (0.14.0)
How I do fix that?
How can I show validation errors?
The creation of the Category I need to pass the establishment_id how can I do this? being that he is not an attribute attr_accessible