undefined method `to_sym' for nil:NilClass


When updating a ReferralProgram object that has nested Pages in it I
get the error in the subject line.

Rails generates parameters that look like this:


When the id parameter is removed like this:


The exception is not raised. Any ideas on this?

The relevant part that 'crashes' the form:


I can't really test this right now but here's a thought:

- If you create a new ReferralProgram with new Pages there shouldn't
be a Page ID in the params because these Pages don't exist yet (If you
assign existing pages double check if a Page with that ID exists).
- If I remember this correctly multiple nested objects have to be in
an array in the params like:

"pages_attributes" => [ {"body"=>"blabla", "subject"=>"blabla"},
{"body" => "blublu", "subject"=>"blublu"} ]

Hope this helps a little!

I was using the to-csv and fastercsv gem. When I commented them out of
my environment.rb, the error disappeared. I don't know which gem was
causing it, but not using either of them has fixed it for now. I will
still need CSV export functionality, but now I can at least test if it
doesn't break nested forms .. :slight_smile:

Thanks Simon!


I'm facing the exact same error right now.
Is there a solution to this issue?

I'd really like to use to-csv+fastercsv.

Let me know.

THX alot,


Commander Johnson wrote: