Newbie Issue

I am a newbie to RoR. I am struggling to find out why my first RoR
program does not show me the labels and the fields for my table.

This is what I did so far:

  1. Installed RoR 1.8.6.
  2. Installed NetBeans 6.8
  3. Installed MySQL 5.5
  4. Created my first project called “company”
  5. Generated a model “employee”
  6. Edited the employees.rb file to include 3 new
    columns: :name, :string; :hiredate, :date; :salary, :float
  7. Executed the migrate rake task which successfully created the table
    employee on the mysql database with these fields.
  8. Generated a scaffold called “employee”.

Then I opened my browser and went to http://localhost:8080/employees/new

Here is where my troubles begin. The webpage shows just a “Create”
button, without the labels and text fields for the fields name,
hiredate or salary.
If I click on the “Create” button, it says “created a new employee”
and creates a row with links “show”, “edit” and “destroy”. It does not
show the name, hiredate or salary.
When I checked the database, there is an empty row in the employees
table.
When I click on the Edit button, it says “successfully updated” but
still does not show the fields.

What am I missing?

On Jan 19, 2:03Â pm, suryava [email protected] wrote:

I am a newbie to RoR. I am struggling to find out why my first RoR
program does not show me the labels and the fields for my table.

This is what I did so far:

  1. Installed RoR 1.8.6.

I suspect you mean ruby 1.8.6 and some other version of rails (since
there is no version 1.8.6)

[snip]

If I click on the “Create” button, it says “created a new employee”
and creates a row with links “show”, “edit” and “destroy”. It does not
show the name, hiredate or salary.
When I checked the database, there is an empty row in the employees
table.
When I click on the Edit button, it says “successfully updated” but
still does not show the fields.

What am I missing?

Scaffolding does not inspect your database - it will show controls/
labels for those attributes that you tell it about when you run the
scaffolding generator

Fred

2010/1/19 suryava [email protected]:

  1. Edited the employees.rb file to include 3 new
    If I click on the “Create” button, it says “created a new employee”
    and creates a row with links “show”, “edit” and “destroy”. It does not
    show the name, hiredate or salary.
    When I checked the database, there is an empty row in the employees
    table.
    When I click on the Edit button, it says “successfully updated” but
    still does not show the fields.

What am I missing?

Have a look at the GettingStarted guide at
http://guides.rubyonrails.org/

Colin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs