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

Unabled to move the partial to a shared location

Open rnhurt opened this issue 14 years ago • 1 comments

I am using add_child_link() in several places around my project to add a common "address" partial, however when I try to move it to a central location (/app/views/shared/_address.erb) I get the following error:

  You have a nil object when you didn't expect it!
  The error occurred while evaluating nil.klass

I tried to something like add_child_link "Add an address", f, :options => { :partial => "shared/address" } but it didn't help.

What is the recommended way to use this with partials that have a different path or name?

rnhurt avatar Sep 24 '09 21:09 rnhurt

The add child link method does not take an options hash, so I should probably adjust this so it does. Thanks for the suggestion.

ryanb avatar Sep 26 '09 19:09 ryanb