Well yes, I can /see/ that it was removed from trunk in revision 6632 <http://dev.rubyonrails.org/changeset/6632/trunk/railties/lib/rails_generator/generators/components/scaffold_resource>, but /why/? And what are we supposed to use in its place? I searched around and couldn''t find any discussion about scaffold_resource being removed, except for this cryptic comment by David: You''re dead! We killed you! So I''m guessing we''re all supposed to start using the plain old scaffold generator instead? There are quite a few articles <http://earthcode.com/blog/2007/01/nested_crud_resources_in_rails.html> and at least one book <http://safari.oreilly.com/9780321501745/ch04lev1sec2?imagepage=34> that tell people to use script/generate scaffold_resource... For example: Rails provides two similar resource generators. The first, |scaffold_resource|, generates full scaffolding of model, view, helper, tests, and controllers for a resource. As arguments, it takes the model name (in singular form) and an optional list of property names and data types for the model. The |scaffold_resource| generator is run using ruby script/generate scaffold_resource task name:string description:text due_date:date The second generator, |resource|, provides the same functionality as |scaffold_resource|, but does not create any views. Its syntax is identical to the |scaffold_resource| syntax. The |resource| generator is useful when views written by |scaffold_resource| will be overwritten immediately with custom views. Both generators create controller code [wrong!] that is similar to the code shown earlier in the |TasksController|. In addition, the generators create a model with an appropriate migration to create the fields specified in the command line. These two tools are useful for cranking out many skeleton resources at the beginning of a project. I for one (probably because I''m a newbie to this REST stuff) think it''s handy to be able to generate a fully functional scaffold for my restful resource and am disappointed that it was removed. Anyway, for anyone else in the same boat as me, there is at least one way to keep using scaffold_resource: svn export -r 6631 \ http://dev.rubyonrails.org/svn/rails/trunk/railties/lib/rails_generator/generators/components/scaffold_resource/@6631 \ vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/ Hope that helps someone. Thanks for your time! -- Tyler Rick http://whynotwiki.com/Rails_/_REST --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn
2007-Jul-21 03:53 UTC
Re: What happened to the scaffold_resource generator?
The name changed to just "scaffold" http://dev.rubyonrails.org/changeset/6768 Sorry for you rant. -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org On Jul 20, 2007, at 11:17 PM, Tyler Rick wrote:> Well yes, I can see that it was removed from trunk in revision > 6632, but why? And what are we supposed to use in its place? > > I searched around and couldn''t find any discussion about > scaffold_resource being removed, except for this cryptic comment by > David: > You''re dead! We killed you! > So I''m guessing we''re all supposed to start using the plain old > scaffold generator instead? > > There are quite a few articles and at least one book that tell > people to use script/generate scaffold_resource... For example: > Rails provides two similar resource generators. The first, > scaffold_resource, generates full scaffolding of model, view, > helper, tests, and controllers for a resource. As arguments, it > takes the model name (in singular form) and an optional list of > property names and data types for the model. The scaffold_resource > generator is run using > > ruby script/generate scaffold_resource task name:string > description:text due_date:date > > The second generator, resource, provides the same functionality as > scaffold_resource, but does not create any views. Its syntax is > identical to the scaffold_resource syntax. The resource generator > is useful when views written by scaffold_resource will be > overwritten immediately with custom views. > > Both generators create controller code [wrong!] that is similar to > the code shown earlier in the TasksController. In addition, the > generators create a model with an appropriate migration to create > the fields specified in the command line. These two tools are > useful for cranking out many skeleton resources at the beginning of > a project. > > I for one (probably because I''m a newbie to this REST stuff) think > it''s handy to be able to generate a fully functional scaffold for > my restful resource and am disappointed that it was removed. > > Anyway, for anyone else in the same boat as me, there is at least > one way to keep using scaffold_resource: > > svn export -r 6631 \ http://dev.rubyonrails.org/svn/rails/ > trunk/railties/lib/rails_generator/generators/components/ > scaffold_resource/@6631 \ > vendor/rails/railties/lib/rails_generator/generators/components/ > scaffold_resource/ > > Hope that helps someone. Thanks for your time! > -- > Tyler Rick > http://whynotwiki.com/Rails_/_REST--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It was not removed - it became the default. Tyler Rick wrote:> Well yes, I can /see/ that it was removed from trunk in revision 6632 > <http://dev.rubyonrails.org/changeset/6632/trunk/railties/lib/rails_generator/generators/components/scaffold_resource>, > but /why/? And what are we supposed to use in its place? > > I searched around and couldn''t find any discussion about > scaffold_resource being removed, except for this cryptic comment by David: > > You''re dead! We killed you! > > So I''m guessing we''re all supposed to start using the plain old scaffold > generator instead? > > There are quite a few articles > <http://earthcode.com/blog/2007/01/nested_crud_resources_in_rails.html> > and at least one book > <http://safari.oreilly.com/9780321501745/ch04lev1sec2?imagepage=34> that > tell people to use script/generate scaffold_resource... For example: > > Rails provides two similar resource generators. The first, > |scaffold_resource|, generates full scaffolding of model, view, > helper, tests, and controllers for a resource. As arguments, it > takes the model name (in singular form) and an optional list of > property names and data types for the model. The |scaffold_resource| > generator is run using > > ruby script/generate scaffold_resource task name:string description:text due_date:date > > > The second generator, |resource|, provides the same functionality as > |scaffold_resource|, but does not create any views. Its syntax is > identical to the |scaffold_resource| syntax. The |resource| > generator is useful when views written by |scaffold_resource| will > be overwritten immediately with custom views. > > Both generators create controller code [wrong!] that is similar to > the code shown earlier in the |TasksController|. In addition, the > generators create a model with an appropriate migration to create > the fields specified in the command line. These two tools are useful > for cranking out many skeleton resources at the beginning of a project. > > I for one (probably because I''m a newbie to this REST stuff) think it''s > handy to be able to generate a fully functional scaffold for my restful > resource and am disappointed that it was removed. > > Anyway, for anyone else in the same boat as me, there is at least one > way to keep using scaffold_resource: > > svn export -r 6631 \ > http://dev.rubyonrails.org/svn/rails/trunk/railties/lib/rails_generator/generators/components/scaffold_resource/@6631 > \ > > vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/ > > Hope that helps someone. Thanks for your time! > > -- > Tyler Rick > http://whynotwiki.com/Rails_/_REST--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn wrote:> The name changed to just "scaffold" > http://dev.rubyonrails.org/changeset/6768 > > -Rob >Well I feel dumb. I''d just never thought to try ''scaffold'' because I figured it was the "old" (non-restful) scaffold. Now I know... Thanks! -Tyler --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
mcf1986-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Sep-02 19:01 UTC
Re: What happened to the scaffold_resource generator?
I made the same mistake, spent 10 mins googling, Couldn''t find ''scaffold_resource'' generator, thank god I found this. On Jul 23, 4:53 pm, Tyler Rick <tyler.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Rob Biedenharn wrote: > > The name changed to just "scaffold" > >http://dev.rubyonrails.org/changeset/6768 > > > -Rob > > Well I feel dumb. I''d just never thought to try ''scaffold'' because I > figured it was the "old" (non-restful) scaffold. Now I know... > > Thanks! > -Tyler--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---