hi, i have installed ruby 1.8.6 window version, rails 2.1.0
everything runs fine except SCAFFOLD when i run ruby script/generate scaffold modelname controllername actions e,g. C:depot>ruby script/generate scaffold Product Admin
hi, i have installed ruby 1.8.6 window version, rails 2.1.0
everything runs fine except SCAFFOLD when i run ruby script/generate scaffold modelname controllername actions e,g. C:depot>ruby script/generate scaffold Product Admin
hi, i have installed ruby 1.8.6 window version, rails 2.1.0
everything runs fine except SCAFFOLD when i run ruby script/generate scaffold modelname controllername actions
you don't need the "controllername actions" when using scaffold. a
RESTful controller will be generated for you.
(from the help)
Usage: ./script/generate scaffold ModelName [field:type, field:type]
For example, `scaffold post title:string body:text published:boolean`
Type "ruby script/generate scaffold" for the full help.
Best. Mike
hi, i have installed ruby 1.8.6 window version, rails 2.1.0
everything runs fine except SCAFFOLD when i run ruby script/generate scaffold modelname controllername actions e,g. C:depot>ruby script/generate scaffold Product Admin
What doesn't happen that you expected to happen? I assume you know that scaffolding changed substancially in 2.0, so if you're following a tutorial written for 1.2.x might be time to find a more up to date one
Fred
thank u Frederick, i was using old tutorial, now it's clear to me, sanjay shankar
Frederick Cheung wrote:
Hey Mike,
I've encountered similar problems to Sanjay.
Now, you say that with scaffolds in 2.0 you don't NEED to specify a controller name anymore. However, I WANT to specify the controller name. I wish to create a model for a class called 'product' that is controlled by a controller named 'admin', NOT 'products'.
Mike, is it possible in any way, shape or form to name the controller with the new scaffolds in 2.0?
The only solutions I've been able to find have involved manually correcting every mention of the controller in the generated code - which definitely isn't good programming! It seems to odd to me that scaffolds cannot be customised anymore. It must be so commonplace to want to name your controller!