Displaying 1 result from an estimated 1 matches for "dishes_ingredients".
2006 Nov 14
3
messed-up habtm relationship
Hi,
I have a many-to-many relationship between dishes and ingredients
class Dish < ActiveRecord::Base
has_and_belongs_to_many :ingredients
end
class Ingredient < ActiveRecord::Base
has_and_belongs_to_many :dishes
end
I have a join table dishes_ingredients
now when i access my_dish.ingredients, i get a list of what looks like
Ingredient objects, but the but they don''t have the right attributes:
#<Ingredient:0x29d3544 @readonly=true, @attributes={"name"=>"Chicken",
"ingredient_id"=>"36", &q...