Switching from 1.2.8 -> 2.1: Scaffold doesn't display MySQL fields

Hi everyone,

I’m currently trying to switch to the newest version of Rails and I’ve
already set up a test application and connected it to MySQL using “–
databse=mysql”. The database is named accordingly, so the app is
called “the_app”, the database is called “the_app_development” and I
created a table “posts” inside the database.
When I create a scaffold using “script/generate scaffold Post” it
generates all the files but the content (include table headers, form
fields etc.) doesn’t show up. I get the titles like “Listing posts”
and also links to Show, Edit, Destroy and New post but not the actual
content/form fields.

Hi,

created a table “posts” inside the database.
When I create a scaffold using “script/generate scaffold Post” it
generates all the files but the content (include table headers, form
fields etc.) doesn’t show up. I get the titles like “Listing posts”
and also links to Show, Edit, Destroy and New post but not the actual
content/form fields.

yes… the behavior of the scaffold generator changed. Now you have to
tell Rails which fields/types you want to include in the scaffold.
Something like

script/generate scaffold Post title:string publicated_at:datetime

and so on

good luck!


javier ramírez

…i do ruby on rails development in madrid, spain, at
http://www.aspgems.com
…you can find out more about me on http://formatinternet.wordpress.com
and http://workingwithrails.com/person/5987-javier-ramirez

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