ryanb/nested_form — pull request #104 by SweeD (2011-10-20 13:08:56+00:00)
Title: Added :object_model option to link_to_add

Hello Ryan,

I've added the :object_model - key to the options in the link_to_add method.

Reason:

If i want to render another fields_for block into the nested_form i need to build this first.
Then i have to give it to the link_to_add as a model_object, but this wasn't possible until now.

Example:

```eruby
...
<%= fields_for :tasks do |ft| %>
<%= ft.text_field :name %>
<%= fields_for :co_worker do |fcw| %>
...
<% end %>
<% end %>
<%= link_to_add :tasks, :model_object => Task.new(:co_worker => CoWorker.new) %>
...
```

I know, the example isn't really nice, but i think you get the idea. ;)

What do you think about?

Greetz
SweeD