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? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Or you could do script/generate scaffold <name> fieldname1:string fieldname2:datetime and so on. On Dec 14, 2007 1:09 PM, Rob Biedenharn <Rob-GBZH0y1GwQfnZcttdmLDtcI/UQi/AW5J@public.gmane.org> wrote:> > 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 Biedenharn http://agileconsultingllc.com > Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org > > > > > >-- Ryan Bigg http://www.frozenplague.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---