Errors when using a Ruby On Rails scaffold with a data type of interger

Posted by bublebboy on Stack Overflow See other posts from Stack Overflow or by bublebboy
Published on 2010-12-29T05:46:27Z Indexed on 2010/12/29 5:54 UTC
Read the original article Hit count: 183

I am learning Ruby On Rails. I am on a shared hosting with Ruby version 1.8.1 and Rails version 2.3.10. I am working my way through a tutorial at http://railstutorial.org/chapters/a-demo-app?version=2.3#top and at one point in the tutorial it has me run:

script/generate scaffold Micropost content:string user_id:interger

The tutorial is using the default database, SQLite3. The command works and I use rake db:migrate to create the database. I can view the page listing the microposts (which is empty), but when I try to add a micropost (microposts/new) I get an error undefined method `user_id' for #<Micropost:0x7f710e4988e8> After doing some testing on my own it seems I experience the problem by using the data type of interger.

While I understand that using a scaffold is not the best way of building a ruby on rails, I'm just beginning and would still like to know why I am experiencing this problem to help me better understand how rails works.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about sqlite3