snusnu/dm-accepts_nested_attributes — Issue #11: Child model's parent_id attribute isn't set for has 1 associations.
Author: mltsy
Created: 2011-12-05 21:02:04+00:00
State: open

I may well be using this wrong, or maybe this is intentional, but I have code like the code below, and for some reason, it's requiring me, in the Tag#update action, to manually set `params[:tag][:tag_controller_attributes][:tag_id]` - is that normal?

It seems like that should be something DANA could set automatically.

```
class Tag
[...]
has 1, :tag_content
accepts_nested_attributes_for :tag_content
[...]
end

class TagContent
[...]
belongs_to :tag
[...]
end

class TagsController < ApplicationController
def edit
[...]
@tag.tag_content ||= TagContent.new
[...]
end
[...]
end

// edit.html.erb
<%= form_for @tag do |f| %>
[...]
<%= f.fields_for @tag.tag_content do |content_form| %>
[...some fields...]
<% end %>
<% end %>
```