On 1 March 2012 23:03, Brandon Might wrote:
> My models:
>
> class Product < ActiveRecord::Base
>
>
> has_many :Orders_Products
That should be :orders_products all lower case, so matching the table
name. The same applies to all later relationships.
Colin
> has_many :Orders, through: :O
Okay. I have it 90% working now. My main problem was i had has_may :table,
through: :table where it should have been has_many: :table, :through =>
:table.
Now that I got that worked out I cant get it to save those extra columns.
On Thursday, March 1, 2012 6:51:06 PM UTC-5, Brandon Might wrote:
Correction:
class OrdersProduct < ActiveRecord::Base
belongs_to :Order
belongs_to :Product
end
On Thursday, March 1, 2012 6:03:37 PM UTC-5, Brandon Mi
My models:
class Product < ActiveRecord::Base
has_many :Orders_Products
has_many :Orders, through: :Orders_Products
end
class OrdersProduct < Ac
On Feb 28, 2012, at 11:42 PM, Brandon Might wrote:
> So this whole many-to-many thing has me really confused. I get how to set it
> up but I can't seem to find anywhere that really explains the best way to use
> it in your controller.
>
> What I have:
>
> Products, Orders, Orders_Products
>
So this whole many-to-many thing has me really confused. I get how to set
it up but I can't seem to find anywhere that really explains the best way
to use it in your controller.
*What I have:*
Products, Orders, Orders_Products
The Products and Orders table has the standard stuff (Id, name, t
6 matches
Mail list logo