# Problems with simple scaffold code

**URL:** <https://www.ruby-forum.com/t/problems-with-simple-scaffold-code/97661>\
**Category:** Rails\
**Created:** [January 26, 2006, 3:17pm UTC](https://www.ruby-forum.com/t/problems-with-simple-scaffold-code/97661 "2006-01-26T15:17:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lbolognini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@lbolognini](https://www.ruby-forum.com/u/lbolognini)\
**Post date:** [January 26, 2006, 3:17pm UTC](https://www.ruby-forum.com/t/problems-with-simple-scaffold-code/97661/1 "2006-01-26T15:17:18Z")

</div>

Hi all,

I had scaffold generate some code on a brand new app the trace is here:

[http://rafb.net/paste/results/H87GHC68.html](http://rafb.net/paste/results/H87GHC68.html)

Could you point me to what problem needs to be fixed please as i’ve been  
banging my head against this for some time now?

The table is very simple and its called “user” with id, email, password  
fields. I’ve set pluralize\_table\_names to false and set\_table\_name  
‘user’. That’s all i tweaked the rest is all scaffold’s fault 😉

Ah yeah, my stack is winxp, ruby 1.8.2, rails 1.0, webrick, postgresql  
8.1

The connection with the db certainly works otherwise generate/scaffold  
would have generated an error.

Any thoughts?

Lorenzo

---

<div class="post-metadata">

**Author:** ![lbolognini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@lbolognini](https://www.ruby-forum.com/u/lbolognini)\
**Post date:** [January 26, 2006, 3:23pm UTC](https://www.ruby-forum.com/t/problems-with-simple-scaffold-code/97661/2 "2006-01-26T15:23:23Z")

</div>

“user” is reserved PostgreSQL keyword. Rename the table.  
I’d suggest never use table names which clash with reserved keywords.

2006/1/26, Lorenzo B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![lbolognini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@lbolognini](https://www.ruby-forum.com/u/lbolognini)\
**Post date:** [January 26, 2006, 3:24pm UTC](https://www.ruby-forum.com/t/problems-with-simple-scaffold-code/97661/3 "2006-01-26T15:24:10Z")

</div>

> Ah yeah, my stack is winxp, ruby 1.8.2, rails 1.0, webrick, postgresql  
> 8.1

I just read that user is a reserved keyword in postgresql…try  
renaming your table…

This is secondhand info…

Mikkel

---

<div class="post-metadata">

**Author:** ![lbolognini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@lbolognini](https://www.ruby-forum.com/u/lbolognini)\
**Post date:** [January 26, 2006, 10:26pm UTC](https://www.ruby-forum.com/t/problems-with-simple-scaffold-code/97661/4 "2006-01-26T22:26:40Z")

</div>

Lugovoi N. wrote:

> “user” is reserved PostgreSQL keyword. Rename the table.  
> I’d suggest never use table names which clash with reserved keywords.

Tnx guys! That fixed the problem!

Lorenzo
