For example I have table Questions. With fields id, text, and test_id. test_id is not being displayed in my view. I am hoping this means Rails has picked up that it is an id for another model. If so, then how do I utilize that? If not, then do I need to avoid ''id'' in any field names other than the main id field? Thanks! -- Posted via http://www.ruby-forum.com/.
It''ll be because fields named xxx_id are supposed to be foreign fields. You have to customise stuff to make that show up how you want... scaffold won''t do it. -Nathan On 31/03/06, Arch Stanton <d6veteran@gmail.com> wrote:> For example I have table Questions. With fields id, text, and test_id. > > test_id is not being displayed in my view. I am hoping this means Rails > has picked up that it is an id for another model. If so, then how do I > utilize that? > > If not, then do I need to avoid ''id'' in any field names other than the > main id field? > > Thanks! > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
unknown wrote:> It''ll be because fields named xxx_id are supposed to be foreign > fields. You have to customise stuff to make that show up how you > want... scaffold won''t do it. > -NathanYes they are foreign keys. Can anyone point me to some examples of how to link up those realtionships in Rails? thanks. -- Posted via http://www.ruby-forum.com/.
You really should check the documentation before asking this list. http://api.rubyonrails.org/classes/ActiveRecord/Associations/ ClassMethods.html On Friday, March 31, 2006, at 9:17 AM, Arch Stanton wrote:>unknown wrote: >> It''ll be because fields named xxx_id are supposed to be foreign >> fields. You have to customise stuff to make that show up how you >> want... scaffold won''t do it. >> -Nathan > >Yes they are foreign keys. Can anyone point me to some examples of how >to link up those realtionships in Rails? > >thanks. > >-- >Posted via http://www.ruby-forum.com/. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/railsMikkel Bruun www.strongside.dk - Football Portal(DK) nflfeed.helenius.org - Football News(DK) ting.minline.dk - Buy Old Stuff!(DK) -- Posted with http://DevLists.com. Sign up and save your time!