After scaffolding no data is shown


i’m a newbie . . . after a few installation problems finally i got
ruby and the rails running.

however, i did the scaffolding on a sample database (i created 2
records) and on the main page i see 2 edit and 2 delete links. which
means to me that the model is connected to the database … . .

i clicked on the “new” link and created another record with a title
and a little text. it created a new record but didn’t save the data to
the DB just got a new id.

i’m running a debian 4 with xampp and apache2 …

thank you for your help…


Well your problem sounds weird. Usually a id is assigned only when the
record is saved to the database. However please report the rails
version you are using. Rails 2.0 is not supporting scaffold anymore.

Check out the AWDwR screencast series at , I cover the topic of using scaffold in Rails

On Jan 11, 2008 5:20 PM, imehesz [email protected] wrote:
Free Ruby and Rails Screencasts

Also a newbie so please tell me if I have a bad assumption.
You used a generator for scaffolding right? Rails 2 has a bit
different syntax and if a part of it is that you explicitly have to
say what columns you want used in the scaffold
(name_of_column:sql_type) . Example, you have a table named pets with
columns name, age, place_of_birth … You generate a scaffold with
script/generate scaffold Pet name:text age:integer …
Hope this helped


if I type: “ruby -v” I got this back:
ruby 1.8.5 (2006-08-25) [i486-linux]

so i guess this is not 2.0 :frowning: what I did under debian:

“apt-get install ruby rdoc1.8 irb libyaml-ruby libzlib-ruby”

i downloaded the gems and … :
“gem1.8 install rubygems”

and the rails:
“gem1.8 install rails”

something was going on and I had to install openssl … everything
seemed fine so I looked up some tutorials and tried one of the
examples … that’s all

i am an old time PHP guy :wink: so i knew something is very weird when I
could insert a new record but only the ID got saved …

thanks for your advices … i’ll check 'em out!


i am sooo stupidos sorry… my RAILS version is:
Rails 2.0.2 :frowning: as I said. i’m a newbie :smiley:


thank you,

it did help … that was an old tutorial.