# Scaffold skip "xxx\_id" column in table?

**URL:** <https://www.ruby-forum.com/t/scaffold-skip-xxx-id-column-in-table/103234>\
**Category:** Rails\
**Created:** [May 3, 2007, 7:18am UTC](https://www.ruby-forum.com/t/scaffold-skip-xxx-id-column-in-table/103234 "2007-05-03T07:18:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anakintang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5fc32e/32.png) [@anakintang](https://www.ruby-forum.com/u/anakintang)\
**Post date:** [May 3, 2007, 7:18am UTC](https://www.ruby-forum.com/t/scaffold-skip-xxx-id-column-in-table/103234/1 "2007-05-03T07:18:06Z")

</div>

All,

I have a schema which contains two columns called “category\_id” and  
“data\_id”, and “category” and “data” are two other different tables in  
the same database. When I use “Scaffold” to generate the view and  
controller I found that in “\_form.rhtml” there are no input field for  
“category\_id” and “data\_id”. It seems like scaffold skipped them for  
some reason.

Is it what it is suppose to be?

Thanks,  
Yingqi

---

<div class="post-metadata">

**Author:** ![anakintang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5fc32e/32.png) [@anakintang](https://www.ruby-forum.com/u/anakintang)\
**Post date:** [May 5, 2007, 11:56am UTC](https://www.ruby-forum.com/t/scaffold-skip-xxx-id-column-in-table/103234/2 "2007-05-05T11:56:35Z")

</div>

On May 3, 2007, at 07:18 , anakintang wrote:

> I have a schema which contains two columns called “category\_id” and  
> “data\_id”, and “category” and “data” are two other different tables in  
> the same database. When I use “Scaffold” to generate the view and  
> controller I found that in “\_form.rhtml” there are no input field for  
> “category\_id” and “data\_id”. It seems like scaffold skipped them for  
> some reason.

Yup, which is fairly obvious if you look at the actually generated  
code and look up the content\_columns method \<http://  
[ActiveRecord::Base](http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001020)\>.

–  
Jakob S. - [http://mentalized.net](http://mentalized.net)
