Forum: Ruby on Rails Error with fields_from

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
mark (Guest)
on 2008-12-25 01:31
(Received via mailing list)
Heya guys and gals.
I was following ryan bates complex forms #73 + #74 and have come
across a problem which i'm having trouble solving.

my _test.erb partial looks like

<% fields_for "story[acceptence_test][]" do |test_form| %>
<p>
  Test: <%= test_form.text_field :test %>
</p>
<% end %>

When I try to load a page that calls this partial I get
`@story[acceptance_test]' is not allowed as an instance variable name

If I remove the [] from the first line leaving me with only story
[acceptance_tests] the page loads fine, but I can't save the form.

Any ideas?
This topic is locked and can not be replied to.