Displaying 1 result from an estimated 1 matches for "recipes_tagnames".
2006 Jan 19
5
limits of has_and_belongs_to_many
...e been successful in using a join table with two fields named
''recipe_id'' and ''tag_name'' to relate a table called Recipes with a table
called Taggs, using this model:
class Recipe < ActiveRecord::Base
has_and_belongs_to_many :taggs, :join_table => "recipes_tagnames" ,
:association_foreign_key => "tag_name"
end
In this case both Recipes and Taggs have a field called ''id'' as their
primary key, i.e., they are being joined by Recipes.id =
Recipes_Tagnames.recipe_id AND Recipes_Tagnames.tag_name = Taggs.id.
This works just...