small medium large xlarge

16 Oct 2009, 11:36
Robert T. Baird (3 posts)

Hi Guys!

I’ve been doing my best to slowly creep up the learning curve for RoR. I love the language, framework and your books! Unfortunately, I’ve recently hit a bit of a snag. I’ve been working on implementing many models in a single form using Recipe 13. All works well until I introduce a date into my related model.

Just as the recipe states… bq. Date fields cause problems because, for some reason, Rails removes the @[ ]@ from the name of the field. This can be fixed by manually specifying the @:index@ option and setting it to an empty string if the task is new: @<%= task_form.date_select :completed_at, :index => (task.new_record? ? ‘’ : nil) %>@

… unfortunately, the specified fix doesn’t work for me. My app throws the following error: @Status: 500 Internal Server Error@ @expected Hash (got Array) for param `new_planted_plant_attributes’@

And what’s even more frustrating is that with my limited knowledge I can’t even figure out how to dump the param to the console or logger for me to see how it’s being formed.

Can anybody out there offer any advice?

Thanks! Bob Baird

You must be logged in to comment