Rails2.0 scaffold generator

In version rails1.2, we can use script/generate scaffold modelname
controllername, but in version 2, the scafflod generator only receive
the model parameter in this way: script/generate scaffold modelname.
Now, i want to use scaffold generator generate an controller different
the model name, how should i do?

On Dec 13, 2007, at 9:08 PM, rails wrote:

In version rails1.2, we can use script/generate scaffold modelname
controllername, but in version 2, the scafflod generator only receive
the model parameter in this way: script/generate scaffold modelname.
Now, i want to use scaffold generator generate an controller different
the model name, how should i do?

To get the help on a generator, don’t give it any arguments:

script/generate scaffold

In any case, this scaffold is basically the scaffold_resource of 1.2
days. This builds a model, a RESTful controller, the migration, and a
set of RESTful routes (map.resources).

Does it help to just generate the controller?

script/generate controller

You can always change the name(s) to be what you want. You can also
just skip the generator and start from scratch.

-Rob

Rob B. http://agileconsultingllc.com
[email protected]

Or you could do
script/generate scaffold fieldname1:string fieldname2:datetime

and so on.

On Dec 14, 2007 1:09 PM, Rob B. [email protected]
wrote:

script/generate scaffold
just skip the generator and start from scratch.

-Rob

Rob B. http://agileconsultingllc.com
[email protected]


Ryan B.
http://www.frozenplague.net

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