SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I don't see the fields on the form

    Folks,

    I am new to RoR. I installed Ruby 1.8.6 and netBeans. I am using MySQL 5.5.

    First I created a new rails project, called it "company".
    Then I generated a new model, called it "Employee"
    I added three columns :name, :hiredate, and :comments to this table.
    I then migrated it so it created the table "employees" on my MySQL Database perfectly.

    I then generated a scaffold for the "employees" successfully. Now when I go to localhost:8080/employees/new, it shows all the links to add, list, etc but it does not show the fields for the Name, Hiredate and comments.

    If I just click on "Add" it just creates an empty row in the database. How do I have it generate the text boxes and the labels for the fields?

    Pls help.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2010
    Location
    Cleveland, OH
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you post the template code for the new action? This can be found in app/views/employees/new.html.erb

  3. #3
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kmsolorio View Post
    Can you post the template code for the new action? This can be found in app/views/employees/new.html.erb
    Thank you for your response. But I found the answer to my question. I did not know that I have to repeat the table structure as scaffold generate parameters.

    Once I did that, the app works fine.

    Thanks once again.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •