ceth
ceth

Reputation: 45335

Create a view for the model

I am reading "Pragmatic Agile Web Development with Rails (2th ed)" and trying examples from this book. But when I am trying one of examples I have got error.

So:

I have googled and found this solution:

ruby script/generate scaffold product title:string description:text image_url:string

But I am not sure that it is a right way. What is the 'true way' to create a view for the product table ?

Upvotes: 0

Views: 960

Answers (2)

fantactuka
fantactuka

Reputation: 3334

To create an example you'd just run

ruby script/generate scaffold Product title:string description:text image_url:string

This will generate MVC structure for products

Upvotes: 1

alex.zherdev
alex.zherdev

Reputation: 24174

scaffold method has been removed from Rails since about 2.0 version. Since that time, one should use the generator for scaffolding.

Upvotes: 2

Related Questions