When you use rails g scaffold blah blah it will always produce non-final code, so why not have a scaffolds folder with as many dummy code examples as possible which can then be transplanted into the actual production code. For example nested forms or select box code or whatever might be specific to a custom generator (mobile or whatever) This could be very much like "snippets", a scaffold could then make many more assumptions and potentially create non-working code, like assuming that something_id is something that can be used in a selection box and that "name" is the value of an option. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/NLPrG3ki9k8J. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tuesday, 1 May 2012 15:20:57 UTC-4, Joe Le Brech wrote:> > When you use rails g scaffold blah blah it will always produce non-final > code, so why not have a scaffolds folder with as many dummy code examples > as possible which can then be transplanted into the actual production code. > > For example nested forms or select box code or whatever might be specific > to a custom generator (mobile or whatever) > > This could be very much like "snippets", a scaffold could then make many > more assumptions and potentially create non-working code, > like assuming that something_id is something that can be used in a > selection box and that "name" is the value of an option. >Part of the point of things like scaffolding is to demonstrate where code should go for new users of the framework, and to provide a quick working example - scattering them into a folder full of non-working examples would make that much more difficult. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/saHFAud_3-wJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jeremy Walker
2012-May-02 14:38 UTC
Re: Scaffoldings should be made in a temporary folder.
On 1 May 2012 20:20, Joe Le Brech <jlebrech-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> When you use rails g scaffold blah blah it will always produce non-final > code, so why not have a scaffolds folder with as many dummy code examples > as possible which can then be transplanted into the actual production code. > > For example nested forms or select box code or whatever might be specific > to a custom generator (mobile or whatever) > > This could be very much like "snippets", a scaffold could then make many > more assumptions and potentially create non-working code, > like assuming that something_id is something that can be used in a > selection box and that "name" is the value of an option. > >You suggest that scaffolding always produces non-final code. In my experience, it often creates the scaffolding for the final code, where very little needs changing for the resulting page. If that resulting page is complex, then don''t generate scaffolding, just generate a resource. If the functionality is going to be along the lines of a form-based resource, then I''ve found that scaffolding can be a helpful start. Jeremy Walker http://www.ihid.co.uk -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Dimitri Pekarovsky
2012-May-03 13:29 UTC
Re: Scaffoldings should be made in a temporary folder.
In such particular case you could use git branch or something like that? //D вторник, 1 мая 2012 г., 22:20:57 UTC+3 пользователь Joe Le Brech написал:> > When you use rails g scaffold blah blah it will always produce non-final > code, so why not have a scaffolds folder with as many dummy code examples > as possible which can then be transplanted into the actual production code. > > For example nested forms or select box code or whatever might be specific > to a custom generator (mobile or whatever) > > This could be very much like "snippets", a scaffold could then make many > more assumptions and potentially create non-working code, > like assuming that something_id is something that can be used in a > selection box and that "name" is the value of an option. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/CDYawmpye0AJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.