This project is archived and is in readonly mode.
fields_for does not accept an array as first argument
Reported by ravinggenius | August 13th, 2010 @ 06:32 PM
According to documentation I found (http://railsapi.com/doc/rails-v3.0.0RC/classes/ActionView/Helpers/F...) fields_for's first argument should accept an array. However I get an error pointing at line 1 in my HAML partial (fields_for is on line 1). I verified that @node is a valid model and not an array.
= fields_for [:admin, @node] do |form|
...
Gives me the following error:
undefined method `model_name' for Array:Class
Replacing fields_for with form_for works:
= form_for [:admin, @node] do |form|
...
Comments and changes to this ticket
-
ravinggenius August 14th, 2010 @ 01:52 PM
I should have better vetted this issue before filing a bug report. Removing the [] from fields_for worked perfectly.
Please disregard.
-
Neeraj Singh August 18th, 2010 @ 12:03 PM
- State changed from new to invalid
- Importance changed from to Low
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="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>