Topic: Please help me, error scaffold

I'm learning about Ruby on Rails. Please help me.
Althougth I do step-by-step with books(config data, generate model, add
data field in db/migrate/file.rb) but i can't generate scaffold completely.

When run command: ruby script\generate scaffold Employee
And check:  http://127.0.0.1:3000/employees/
--> it shows successful with show,edit,destroy however it can't show
data field although i inserted data in mysql. It shows:
                ---------------------------------------------
                Listing employees

                Show Edit Destroy
                Show Edit Destroy

                New employee
                ----------------------------------------
Or if i click on: New employee, it doesn't have textbox to input data.
It shows:
                ---------------------------------
                New employee

                Back
                ----------------------------------

About your application’s environment:

Ruby version 1.8.6 (i386-mswin32)
RubyGems version 0.9.4
Rails version 2.0.2
Active Record version 2.0.2
Action Pack version 2.0.2
Active Resource version 2.0.2
Action Mailer version 2.0.2
Active Support version 2.0.2
Application root C:/Aptana Studio/company
Environment development
Database adapter mysql
Database schema version 1

Re: Please help me, error scaffold

off of the top of my head I know that scaffold is different now
script/generate scaffold model_name property:type
So it creates tabels as well. Right now you have zero tables I think but thats off of the top of my head as the tables edits ar e not in your code to display nything.

The books are now out of date yet again.
look at peepcode.com rails2.pdf for better details. Yeah it costs money. 9$

Re: Please help me, error scaffold

You have to add the fields for your forms in the html.erb files that were generated. Scaffold generator will only generate the html forms for you if you specify the names of the fields in the ./script/generate command.

Ryan Heneise  |  Art of Mission  |  Now with extra-strong Donor Tools mojo

Re: Please help me, error scaffold

This might help: http://www.softiesonrails.com/2008/1/29 … -rails-2-0

Ryan Heneise  |  Art of Mission  |  Now with extra-strong Donor Tools mojo

Re: Please help me, error scaffold

Thank everybody, maybe my books are quite old. I fixed error. Rails 2.0 is different

Last edited by sumo (2008-02-03 00:36:06)