Displaying 4 results from an estimated 4 matches for "one_to_many".
2006 Jan 05
13
Naming convention for foreign keys
...ng of the
index is significant. On the above mentioned page, this line is shown in
the example:
constraint fk_items_product foreign key (product_id) references
products(id)
In "fk_items_product", "items" is pluralized but "product" is not. Is
this because it is a one_to_many relationship? If so, how should I read
this statement? Does it matter to Rails what the index is called?
Thanks,
Jakob
--
Posted via http://www.ruby-forum.com/.
2006 May 29
1
Multiple Relations between 2 tables
So I am trying to figure out how I would go about creating the
relationships between two tables, but there are multiple relationships
happening.
The one I am trying to figure out is a one_to_one relationship + a
one_to_many relationship.
Example:
I have a home model and a location model
home has_one location
location has_many homes
The trouble is I have to be able to access both home.location and
location.homes
I don''t want to have locations duplicate if multiple homes have the same
location.
Any help on...
2008 Sep 12
1
Referencing exactly two models of the same kind
...end
The DB Tables should look something like this:
users
id
messages
id, user_id, user2_id;
How do the Rails models and the database tables look like? I''m
generally wondering how to reference more than one model of the same
kind from within another model, without using many_to_many or
one_to_many relationships.
Fritz
--~--~---------~--~----~------------~-------~--~----~
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 f...
2010 Aug 01
0
fields_for can not group its params when ajax
hi
book and page is one_to_many relationship.I want to create them in a
single form.But when clicking create button,the submitted params for
pages are not grouped correctly,
i want
"book"=>{"new_pages"=>[{"name"=>"", "color"=>""},
{"name"=>"...