I am having some trouble finding the right way to delete a relationship
has_many :through. I’m running on edge rails here.
class Recipe < ActiveRecord::Base
has_many :ingredients, :through => :additions
class Ingredient < ActiveRecord::Base
has_many :recipes, :through => :additions
class Addition < ActiveRecord::Base
In my controller:
ingredient = @recipe.additions.find( :first,
:conditions => [‘ingredient_id = ? AND amount = ?’,
redirect_to :action => ‘show’, :id => @recipe.id
Mysql::Error: Unknown column ‘id’ in ‘where clause’: UPDATE additions
recipe_id = NULL WHERE (recipe_id = 16 AND id IN (NULL))
What am I missing?
–Dean - Unscrambler of eggs