Haml doesn't allow you to break the nesting of the HTML document, even with
Ruby code. If your code is structured in such a way that that's required,
refactor it.

On Thu, Jan 28, 2010 at 1:53 PM, John Wells <[email protected]> wrote:

>
>
> On Jan 28, 4:47 pm, Bradley Grzesiak <[email protected]> wrote:
> > Can't you just pull the "fields_for" call outside the %tr? "fields_for"
> > doesn't actually output anything, so as long as you're careful with your
> 'a'
> > and 'b' objects, you should be fine.
>
> No, I don't think so...because elements within the first td need to
> use the a form context. I think what you're saying is this:
>
> - form_for @obj do |a|
>   - fields_for :address, @address do |b|
>     %table
>       %tr
>        %td
>          = a.label :name
>          = a.text_field :name
>           = b.label :street
>          = b.text_field :street
>        %td
>          = b.label :city
>          = b.text_field :city
>
> I'm not certain that's completely legal. I'll give it a show, but
> it'll probably make things difficult in other cases where we build up
> this form through partials (i.e., fields_for might be used in a
> partial, while the form_for would be declared in a file calling that
> partial...
>
> Thanks,
> John
>
> --
> You received this message because you are subscribed to the Google Groups
> "Haml" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected] <haml%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/haml?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" 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/haml?hl=en.

Reply via email to