Ok so I have these 2 classes
class Interface < ActiveRecord::Base
belongs_to :hardware
end
and
class Hardware < ActiveRecord::Base
has_many :interfaces
end
I have a form for a predefined @hardware.interfaces which includes array of Interfaces which is handled like below
<%= text_field_tag "hardware[interfaces][][name]",interface.name %>
<%= text_field_tag "hardware[interfaces][][ip]",interface.ip %>
Now I try to do...
@hardware = Hardware.find(params[:id])
@hardware.update_attributes(params[:hardware])
and it throws the error
Interface(#37298420) expected, got HashWithIndifferentAccess(#24204840)
Could someone clue me in on what's going on? and how to solve this problem?