On May 27, 2007, at 6:46 PM, giles bowkett wrote:
> > Hi, I have a change I want to submit, just want to check that it's > relevant first. > > Is scaffolding continuing as normal? > > When I see posts about getting rid of dynamic scaffolding, does that > refer to scaffolding .erb templates, or to the scaffold controller > method? The current plan (as far as I'm aware) is to keep generated scaffolding, but replace the old-style scaffold templates with ones meant for restful resources. Most or all of this work has already been done in trunk. The new templates use the .erb extension. > The scaffolding templates all use > > <% for x in y %> > > instead of > > <% x.each do |y| %> > > Total subtle psychological difference, but with Rails having such > incredible success, a little thing like that will encourage a lot of > new Ruby programmers to use iterators instead of explicit iteration. There is an assumption that web developers build the models and controllers of a Rails app, but designers often build the view templates. The assumption continues that designers are less likely to know Ruby, so code in templates should be as accessible as possible. To a designer familiar with PHP or Perl, the 'for user in users' style of enumeration is probably more accessible than the 'users.each do |user|' style. > [snip ...] > > The code generated by the scaffolding templates is the first > introduction to Ruby for many people. Using iterators in the > scaffolding is kind of like putting out a welcome mat, and encouraging > people to leave their bad habits at the door. Perhaps it's more like putting out a welcome mat written in a language your friends understand but your guests don't. Personally, I never use the for style enumerators, but I don't use scaffolding for anything except throwaway code either. YMMV. -- Josh Susser http://blog.hasmanythrough.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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
