Ruby on Rails apparently changed the syntax for creating scaffold. I’m trying an example that says to use:
ruby script/generate scaffold tale tale
ruby script/generate scaffold genre genre
The database tables are named “genres” and “tales”. When I don’t repeat, it works ok:
ruby script/generate scaffold tale
ruby script/generate scaffold genre
However, the localhost/genre does not work as described in the book. I can access the page using localhost/genres, but when I select “create” the page only shows:
New genre
(Create button)
Back
Am I missing something that is required to show the input field?
“show create table genres” shows the table is defined as:
CREATE TABLE `genres` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`genre_name` varchar(25) NOT NULL,
`description` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
for the scaffold to generate the input fields on the form, you should pass them in the command itself.
that will generate the same db table you show and with the proper input fields on the views.