This project is archived and is in readonly mode.

#4363 ✓resolved
Ryan Bates

fields_for not working outside ERB

Reported by Ryan Bates | April 10th, 2010 @ 06:31 PM | in 3.0.2

If one calls fields_for in a helper method, then the block result is not returned by the method. For example.

# application_helper.rb
def foobar
  fields_for(:object, do |f|

Calling <%= foobar %> in the view will not output "foobar" in Rails 3 Beta 2 but it will in Rails 2. This breaks some nested form solutions.

I'll look into submitting a patch, but I think changing with_output_buffer to capture in the fields_for method will do the job.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>