I am using scaffolding to create application quickly. I have already
created the database and table (there is only one table: products).
When I use command: ruby script/generate scaffold Product
I get all the scripts generated. When I direct my browser to URL:
http://localhost:3000/products I see only the title of the page like
‘Listing products’ and a link to create new product. That is obvious
as there are no products in the table.
But when I follow link to create new product, it should display me a
form matching to table columns, isn’t it? But does not show me
anything there. What I get is title ‘New product’, a button ‘Create’
and a ‘Back’ link.
Can anyone direct me where I am going wrong with this? Or is there
anything else needed to do for this?
I guess, somehow the rails is not being able to get the table fields.
Hence, it is unable to show the form.
As it gets empty set of table columns, the form displayed is also
Please provide some inputs on this.