On Mon, Jul 19, 2010 at 5:36 PM, Paul Campbell <p...@rslw.com> wrote: > The new router in Rails 3 is clean and concise and marks the > acceptance of instance_exec as a method for writing a gorgeous DSL. > > I'm wondering should something similar be applied to the default form helpers? > > Moving from this: > > <%= form_for(@post) do |f| %> > <%= f.text_field :title %> > <% end %> > > to this: > > <%= form_for(@post) do %> > <%= text_field :title %> > <% end %> > > etc. > > I tried it earlier just to check and kind of expected that it _might_ > already have been implemented. > > I don't know much about the implementation details, other than that > it's possible to do but requires a bit of magic, but I feel like it > might be something worth considering.
The biggest problem with the instance_exec version is that it's pretty ugly if you actually need to pass the helper object into, for instance, a partial. Not really relevant for the router, but *very* relevant for form builders... --Matt Jones -- 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-c...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.