complex-form-examples icon indicating copy to clipboard operation
complex-form-examples copied to clipboard

not compatible with rails 3.1.1

Open yunjiangster opened this issue 14 years ago • 0 comments

I deleted the Gemfile.lock file and upgraded to the latest version of rails. Then I get the following error:

ArgumentError in Surveys#new

Showing /home/jyj/rubys/complex-form-examples-99f5680/app/views/surveys/_form.html.erb where line #7 raised:

wrong number of arguments (4 for 3)

Extracted source (around line #7):

4: <%= f.label :name %>
5: <%= f.text_field :name %> 6:

7: <%= f.fields_for :questions %> 8:

<%= f.link_to_add "Add a question", :questions %>

9:

<%= f.submit "Submit" %>

10: <% end %>

Trace of template inclusion: app/views/surveys/new.html.erb

Rails.root: /home/jyj/rubys/complex-form-examples-99f5680

So it appears that fields_for have different syntax in rails 3.1.1? Is there a quick fix for that? Also how do I set the partial file that fields_for accesses?

yunjiangster avatar Oct 25 '11 08:10 yunjiangster