Hi
I am newbie to rails. I am facing some problems with establing an
association in rails. I have two tables namely customer and product.
Table Name: customers, products
HABTM table name: customers_products
class Customer < ActiveRecord
has_and_belongs_to_many :products
end
class Product < ActiveRecord
has_and_belongs_to_many :customers
end
I need to create an interface wherein I will select the customer_id, and
product_id. On submitting, it should enter the details in
customers_products table
Any help would be of great help
Regards
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---