Ar Chron wrote:
> Umm... no.
> 
> Table 'users' already has an implicit 'id' field (you don't have to 
> mention them in your migrations), just like your 'links' table does. If 
> you are sticking to the rails standard, you needn't declare them, they 
> are the rails default primary key for their respective tables.
> 
> In your 'links' table, a 'user_id' field tells rails that:
> 
> a) this field, 'user_id', contains an id to a record in another table - 
> i.e., this record "belongs to" that record in that table over there,
> 
> and that
> 
> b) the related table is 'users' (field name - '_id', pluralized).

Thanks for letting me know.  In links/new, how would I go about 
including the current user_id?  The only way I know of would be a hidden 
form element, and I would like to keep it all server side.
-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to