On 8/8/07, Daniel N <has.sox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> I''m stumped as to how form_for actually captures the block and
puts it
> into the output.
>
> Looking at the method it''s basically
> form_for( arg list )
> #...
> concat( "open tag", block.binding )
> fields_for( stuff, &block )
> concat( "close tag", block.binding )
> end
>
> and fields_for is basically a yield of a builder object.
>
> so it boils down to:
> concat( "open tag", block.binding )
> yield builder_object
> concat( "close tag", block.binding )
>
> There does not seem to be any binding to the current block in the
> builder. How does the content of the yield get into the output buffer, let
> alone get there in the right place?
>
> Cheers
> Daniel
I thought I''d follow this one up since I found the answer. Sort of.
http://railscasts.com/episodes/40
Yielding to the view is all that is required.
My face is sure red ;)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---