Displaying 4 results from an estimated 4 matches for "one_to_mani".
Did you mean:
one_to_many
2006 Jan 05
13
Naming convention for foreign keys
Hi,
In "Agilge Web Development With Rails" on page 217, an example of
foreign keys is shown.
I am however unable to find a definition of wheater the naming 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
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
2008 Sep 12
1
Referencing exactly two models of the same kind
Hi,
how do I solve this in Rails: Lets say I have a User and a Message.
Now, a Message is sent from one User to another User, which means that
in the Message I have to reference a User twice!
This seems to be a problem, if I do not user one-to-many or many-to-
many relationships, because it seems to me as if I could reference a
Model of the same type only once.
However, I would like the Message
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"=>"","color"=>""}]
but it is