Insert record in table entity-relationship

Bruno Furtado
Tue, 24 Jan 2012 13:36:58 -0000

I''m brazilian, so, sorry for English...

I''m learning Ruby on Rails.

My project has 3 tables:
- food
- restaurant
- food_restaurant

I can insert records in "food" and "restaurant" by default
procedure:
-----------------------------
f = Food.new :name => "Arroz"
f.save

r = Restaurant.new :name => "Madalosso", :street => "Rua
Tal, 290"
r.save
-----------------------------

But, how I insert record in table "food_restaurant".
"food_restaurant" dont have a object class, so I cant create a object
and save...
This table have 2 columns: "id_food" and "id_restaurant"

--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at