I just feel that some system like this (and, I like Adam's implementation better) would have low overhead and possibly enable more beautiful code in these "edge-cases".
However, looks like this method will end up in my /lib ;)
Thanks for the quick feedback.
-hampton.
On 4/6/06, David Heinemeier Hansson
<[EMAIL PROTECTED]> wrote:
> > #Now, to show how this could really increase code readability... here is a
> > re-write of the code earliest in this post.
> >
> > <% for @row in @rows
> > o start_form_tag
> > o text_field(:row, :name)
> > o hidden_field(:row, :id)
> > o end_form_tag
> > end %>
>
> No comment on whether this is a good idea in general.
>
> However, it would seem to me to make more sense to maintain the
> syntactic indicator that you're inside a tag, and have it be this
> instead:
>
> <% for @row in @rows
> % start_form_tag
> % text_field(:row, :name)
> % hidden_field(:row, :id)
> % end_form_tag
> end %>
This is why we have Builder and default .rxml templates. If you have a
big block of code you'd rather not mix with HTML, then make a partial
that uses Builder. rhtml and rxml can be mixed and matched as you
please.
--
David Heinemeier Hansson
http://www.loudthinking.com -- Broadcasting Brain
http://www.basecamphq.com -- Online project management
http://www.backpackit.com -- Personal information manager
http://www.rubyonrails.com -- Web-application framework
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core
_______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core