Displaying 1 result from an estimated 1 matches for "metal_id".
Did you mean:
meta_id
2006 May 24
2
Has Many Through + Join Model + Forms + Confused?
...;Metals" and "Percentages" I want to implement
this using a join model, not using a has_and_belongs_to_many relationship.
(If i''m wrong about that, let me know).
Basically, i have the following tables:
Metals
id
name
Alloys
id
name
Percentages
alloy_id
metal_id
percent
And the following code in my models:
Alloy
has_many :metals, :through => :percentages
has_many :percentages, :dependent => true
Metal
has_many :alloys, :through => :percentages
has_many :percentages, :dependent => true
Percentage
belongs_to :alloy
belongs_to :...