I have an Item resource and an Owner resource.

```
rails g scaffold Item name:string
rails g scaffold Owner name:string

class Item < ActiveRecord::Base
  has_one :owner
  accepts_nested_attributes_for :owner
end

class Owner < ActiveRecord::Base
  belongs_to :item
end

```

My problem is that I cannot create a new Item object referencing an existing Owner object.

```
In /db/migrate/create_owners.rb
def self.up
  ...
  t.integer :item_id
end

rake db:migrate   
rails c

ruby-1.9.2-p0 > o= Owner.create(:name => "Test")
 => #<Owner id: 1, name: "Test", created_at: "...", updated_at: "...">

ruby-1.9.2-p0 > i= Item.create(:owner_attributes => {"id" => Owner.last.id.to_s})
ActiveRecord::RecordNotFound: Couldn't find Owner with ID=1 for Item with ID=

```

I am aware that `Item.create(:owner_id => "1")` would work in this case, but unfortunately this not a viable solution in my app. This is because I am adding and deleting nested attributes on the fly and, for example, need to create a new Item object with one existing Owner object and one new Owner object.

I found these links but couldn't work out if this is a feature or a bug in rails:  

<https://rails.lighthouseapp.com/projects/8994/tickets/4254-assigning-nested-attributes-fails-for-new-object-when-id-is-specified>  

<http://osdir.com/ml/RubyonRails:Core/2011-05/msg00001.html>

Can somebody give me an idea as to how I can make this work or have I misunderstood the correct way to use 'accepts\_nested\_attributes\_for'??

I am using Rails 3.0.5 and Ruby 1.9.2p0.

Thanks in advance.