Hi, I''ve added the following patch: http://dev.rubyonrails.org/attachment/ticket/8514/use_content_tag_helper_in_scaffold.diff It cleans up the html generated by the scaffold generator. It doesn''t change anything major about the structure of the generated code, just mainly ads id''s and classes to the tr''s using content_tag_for and humanizes some labels that weren''t there before. I would like to further add a patch after consulting with you guys first about further possibly controversial changes I''d like to add to it. Firstly I would like to remove the following fields from the generated new and edit forms: * created_at, updated_at * any foreign key field following standard ar foreign id naming My main reason for this is during rails conf I discovered that more and more people are using the scaffold resource for creating code. Almost everyone I talked to had these (well at least the date fields) as pet pieves. My suggestion on how to do this is to add a method editable? to the GeneratedAttribute class. This could then be simply tested in the generators erb files. Regards Pelle -- http://extraeagle.com - Solutions for the electronic Extra Legal world https://wideword.net - Encrypted wysiwyg document sharing http://stakeventures.com - Bootstrapping blog --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On May 29, 9:30 pm, "Pelle Braendgaard" <pel...@gmail.com> wrote:> Hi, > I''ve added the following patch:http://dev.rubyonrails.org/attachment/ticket/8514/use_content_tag_hel... > > It cleans up the html generated by the scaffold generator. It doesn''t > change anything major about the structure of the generated code, just > mainly ads id''s and classes to the tr''s using content_tag_for and > humanizes some labels that weren''t there before.The scaffold UI is great for learning how the routes work, and so on. But I don''t think anyone should be encouraged to take the scaffolding views and morph them into production-quality views. I always end up deleting most of the generated code because my projects always need something different. Just my two cents. Jeff softiesonrails.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 5/30/07, Jeff <cohen.jeff@gmail.com> wrote:> > > I always end up > deleting most of the generated code because my projects always need > something different.Pelle''s idea was to make generated code suck less so you have to delete less. Nice thought, but it was rejected. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Pelle, On May 29, 2007, at 7:30 PM, Pelle Braendgaard wrote:> Hi, > I''ve added the following patch: > http://dev.rubyonrails.org/attachment/ticket/8514/ > use_content_tag_helper_in_scaffold.diff > > It cleans up the html generated by the scaffold generator.I think this is a great idea. Alas, if I understand correctly, it isn''t being accepted by core. :-( Is that true? If so, I''d love to see this made into a plug-in, so we could work on it further, and at least make it available to people who want it. Have you considered that? -enp> It doesn''t > change anything major about the structure of the generated code, just > mainly ads id''s and classes to the tr''s using content_tag_for and > humanizes some labels that weren''t there before. > > I would like to further add a patch after consulting with you guys > first about further possibly controversial changes I''d like to add to > it. > > Firstly I would like to remove the following fields from the generated > new and edit forms: > > * created_at, updated_at > * any foreign key field following standard ar foreign id naming > > My main reason for this is during rails conf I discovered that more > and more people are using the scaffold resource for creating code. > Almost everyone I talked to had these (well at least the date fields) > as pet pieves. > > My suggestion on how to do this is to add a method editable? to the > GeneratedAttribute class. This could then be simply tested in the > generators erb files. > > Regards > Pelle > > -- > http://extraeagle.com - Solutions for the electronic Extra Legal world > https://wideword.net - Encrypted wysiwyg document sharing > http://stakeventures.com - Bootstrapping blog > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 5/30/07, Ernest Prabhakar <ernest.prabhakar@gmail.com> wrote:> If so, I''d love to see this made into a plug-in, so we could work on > it further, and at least make it available to people who want it. > Have you considered that?It seems like this would be a great compromise; it''s relatively easy to create a generator within a plugin. I imagine that many people would find scaffolding that highlights some best practices a useful educational tool. -- * J * ~ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 5/31/07, James Adam <james.adam@gmail.com> wrote:> > > I imagine that many people would find scaffolding that highlights some > best practices a useful educational tool.Exactly! +1 for plugin with awesome scaffolding code. Rails professionals will always write their own code, naturally. But let us not forget how most of us learned ERB and form helpers through scaffolding code. Controller scaffold code is really useful to learn REST and respond_to, also. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
I have thought about releasing it as a plugin, even though I'm thinking that Hampton Caitlin's make_resourceful might be the better option: http://hamptoncatlin.com/2007/make_resourceful-0-1-0-release One thing about the edge scaffold (or the previous resource_scaffold) is that many rails professionals use it now, just to create the basic outline of a controller, model etc. Which we probably never would have with the old scaffold generator. I agree that if the main purpose from the core team with scaffold still is educational, then it should remain simple. However I still think that the code could be improved somewhat in the existing version. Pelle On 5/31/07, Mislav Marohnić <mislav.marohnic@gmail.com> wrote:> On 5/31/07, James Adam <james.adam@gmail.com> wrote: > > > > I imagine that many people would find scaffolding that highlights some > best practices a useful educational tool. > > Exactly! > +1 for plugin with awesome scaffolding code. > > Rails professionals will always write their own code, naturally. But let us > not forget how most of us learned ERB and form helpers through scaffolding > code. Controller scaffold code is really useful to learn REST and > respond_to, also. > > > > >-- http://extraeagle.com - Solutions for the electronic Extra Legal world https://wideword.net - Encrypted wysiwyg document sharing http://stakeventures.com - Bootstrapping blog --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
+1. I never used scaffolds in the pre-1.2.3 days. But now, especially for little internal utilities, they're quite useful. And to expand upon Pelle's point, yes, simple is good... But simple does not have to mean wrong. Theres no reason that things like label tags should not be included... -especially- if its for educational purposes. Tyler On 6/2/07, Pelle Braendgaard <pelleb@gmail.com> wrote:> > I have thought about releasing it as a plugin, even though I'm > thinking that Hampton Caitlin's make_resourceful might be the better > option: > > http://hamptoncatlin.com/2007/make_resourceful-0-1-0-release > > One thing about the edge scaffold (or the previous resource_scaffold) > is that many rails professionals use it now, just to create the basic > outline of a controller, model etc. Which we probably never would have > with the old scaffold generator. > > I agree that if the main purpose from the core team with scaffold > still is educational, then it should remain simple. However I still > think that the code could be improved somewhat in the existing > version. > > Pelle > > On 5/31/07, Mislav Marohnić <mislav.marohnic@gmail.com> wrote: > > On 5/31/07, James Adam <james.adam@gmail.com> wrote: > > > > > > I imagine that many people would find scaffolding that highlights some > > best practices a useful educational tool. > > > > Exactly! > > +1 for plugin with awesome scaffolding code. > > > > Rails professionals will always write their own code, naturally. But let > us > > not forget how most of us learned ERB and form helpers through > scaffolding > > code. Controller scaffold code is really useful to learn REST and > > respond_to, also. > > > > > > > > > > > > -- > http://extraeagle.com - Solutions for the electronic Extra Legal world > https://wideword.net - Encrypted wysiwyg document sharing > http://stakeventures.com - Bootstrapping blog > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
+1 I had made a patch for this a while back. I also think that the forms should be in a partial - especially now that simply_helpful is rolled in. On 6/2/07, Tyler McMullen <tbmcmullen@gmail.com> wrote:> +1. > > I never used scaffolds in the pre-1.2.3 days. But now, especially for > little internal utilities, they're quite useful. > > And to expand upon Pelle's point, yes, simple is good... But simple does not > have to mean wrong. Theres no reason that things like label tags should not > be included... -especially- if its for educational purposes. > > Tyler > > > On 6/2/07, Pelle Braendgaard <pelleb@gmail.com> wrote: > > I have thought about releasing it as a plugin, even though I'm > > thinking that Hampton Caitlin's make_resourceful might be the better > > option: > > > > > http://hamptoncatlin.com/2007/make_resourceful-0-1-0-release > > > > One thing about the edge scaffold (or the previous resource_scaffold) > > is that many rails professionals use it now, just to create the basic > > outline of a controller, model etc. Which we probably never would have > > with the old scaffold generator. > > > > I agree that if the main purpose from the core team with scaffold > > still is educational, then it should remain simple. However I still > > think that the code could be improved somewhat in the existing > > version. > > > > Pelle > > > > On 5/31/07, Mislav Marohnić <mislav.marohnic@gmail.com> wrote: > > > On 5/31/07, James Adam < james.adam@gmail.com> wrote: > > > > > > > > I imagine that many people would find scaffolding that highlights some > > > best practices a useful educational tool. > > > > > > Exactly! > > > +1 for plugin with awesome scaffolding code. > > > > > > Rails professionals will always write their own code, naturally. But let > us > > > not forget how most of us learned ERB and form helpers through > scaffolding > > > code. Controller scaffold code is really useful to learn REST and > > > respond_to, also. > > > > > > > > > > > > > > > > > > > -- > > http://extraeagle.com - Solutions for the electronic Extra Legal world > > https://wideword.net - Encrypted wysiwyg document sharing > > http://stakeventures.com - Bootstrapping blog > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---