Forum: Ruby on Rails ID fields not getting picked up

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A111108ed3617edc35da89e84689c3c2?d=identicon&s=25 Arch Stanton (d6veteran)
on 2006-03-31 08:58
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!
D5145c421cd25af6fa577c15219add90?d=identicon&s=25 unknown (Guest)
on 2006-03-31 09:06
(Received via mailing list)
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
A111108ed3617edc35da89e84689c3c2?d=identicon&s=25 Arch Stanton (d6veteran)
on 2006-03-31 09:17
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.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Mikkel Bruun (Guest)
on 2006-03-31 09:22
(Received via mailing list)
You really should check the documentation before asking this list.

http://api.rubyonrails.org/classes/ActiveRecord/As...
ClassMethods.html


On Friday, March 31, 2006, at 9:17 AM, Arch Stanton wrote:
>
>--
>Posted via http://www.ruby-forum.com/.
>_______________________________________________
>Rails mailing list
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails


Mikkel Bruun

www.strongside.dk    - Football Portal(DK)
nflfeed.helenius.org - Football News(DK)
ting.minline.dk      - Buy Old Stuff!(DK)
This topic is locked and can not be replied to.