# ID fields not getting picked up

**URL:** <https://www.ruby-forum.com/t/id-fields-not-getting-picked-up/93347>\
**Category:** Rails\
**Created:** [March 31, 2006, 8:58am UTC](https://www.ruby-forum.com/t/id-fields-not-getting-picked-up/93347 "2006-03-31T08:58:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![d6veteran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/94ad74/32.png) [@d6veteran](https://www.ruby-forum.com/u/d6veteran)\
**Post date:** [March 31, 2006, 8:58am UTC](https://www.ruby-forum.com/t/id-fields-not-getting-picked-up/93347/1 "2006-03-31T08:58:57Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![d6veteran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/94ad74/32.png) [@d6veteran](https://www.ruby-forum.com/u/d6veteran)\
**Post date:** [March 31, 2006, 9:17am UTC](https://www.ruby-forum.com/t/id-fields-not-getting-picked-up/93347/2 "2006-03-31T09:17:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![d6veteran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/94ad74/32.png) [@d6veteran](https://www.ruby-forum.com/u/d6veteran)\
**Post date:** [March 31, 2006, 9:22am UTC](https://www.ruby-forum.com/t/id-fields-not-getting-picked-up/93347/3 "2006-03-31T09:22:28Z")

</div>

You really should check the documentation before asking this list.

[http://api.rubyonrails.org/classes/ActiveRecord/Associations/](http://api.rubyonrails.org/classes/ActiveRecord/Associations/)  
ClassMethods.html

On Friday, March 31, 2006, at 9:17 AM, Arch S. wrote:

> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

Mikkel B.

www.strongside.dk - Football Portal(DK)  
[nflfeed.helenius.org](http://nflfeed.helenius.org) - Football News(DK)  
ting.minline.dk - Buy Old Stuff!(DK)

---

<div class="post-metadata">

**Author:** ![d6veteran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/94ad74/32.png) [@d6veteran](https://www.ruby-forum.com/u/d6veteran)\
**Post date:** [March 31, 2006, 9:06am UTC](https://www.ruby-forum.com/t/id-fields-not-getting-picked-up/93347/4 "2006-03-31T09:06:53Z")

</div>

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
