RailsCasts Pro episodes are now free!

Learn more or hide this

Kevin Young's Profile

GitHub User: kwyoung11

Site: http://kevinwilliamyoung.com

Comments by Kevin Young

Avatar

Disregard this, I had defined fields_for in a custom form builder and it was overriding the default implementation.

Avatar

EDIT: figured out that it's coming from the arguments passed to fields_for here:

    fields = f.fields_for(association, new_object, child_index: id) do |builder|

why doesn't fields_for accept more than one argument?

Avatar

I am getting a ArgumentError wrong number of arguments (3 for 1), when I call the link_to_add_fields helper method. I've placed it outside of the block for fields_for, like so:

        <%= f.fields_for :exercise do |builder| %>
            <%= render 'exercise_fields', f: builder %>
        <% end %>
        <%= link_to_add_fields "Add Exercise", f, :exercises %>

I'm using rails 4.0 beta. Anyone have any idea why this could be happening?