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