Thank you very much, Frederick!

I'm into my day 5 digging into Rails rendering internals (writing a
plugin) but I didn't think of that.
This part of Rails seems like it needs some tidying..
More questions arise but I'll try to answer them myself first.

Thank you!
Martin

On Sep 13, 1:15 pm, Frederick Cheung <[email protected]>
wrote:
> On Sep 13, 11:00 am, Gogov <[email protected]> wrote:
>
> > Hi all,
>
> > I cannot figure out how to correctly use the with_output_buffer helper
> > method (located in ActionView::Helpers::CaptureHelper) inside a custom
> > FormBuilder.
>
> > Below follows a simplified example.
>
> > I'm trying to achieve the following behavior in an ERB as suggested in
> > the form_for helper docs in the Rails source:
>
> > Inside the MyFormBuilder methods, there's no with_output_buffer method
> > defined so I cannot use it (and a bunch of other Rails helpers; cannot
> > render a partial, etc..).
>
> You need to use builder's @template ivar - this is the view that was
> being rendered so has all the helpers you need (if you look at how a
> form builder's radio_button, check_box etc. methods are implemented,
> they just call the corresponding method on @template)
>
> Fred

-- 
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 [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-talk?hl=en.

Reply via email to