I spent so much time on this and lost half my hair by pulling it. Help.
user
:
has_may :rights
attr_accessible :rights_attributes
right
:
belongs_to :user
attr_accessible :user_id, :pgd_id, :link_id
View:
<%= semantic_form_for @user, :url => {:action => "rightsupdate", :id => @user.id} do |f| %>$
<%= f.inputs do %>$
<%= f.input :pgds, :as => :check_boxes, :required => false %>$
<% end %>$
<%= f.input :link_id, :value => @owner.link_id, :as => :hidden %>$
<%= f.buttons %>$
<% end %>$
but when I update it keeps saying:
WARNING: Can't mass-assign protected attributes: pgd_ids, link_id
I can bypass the pdg
by adding :pgd_ids
to the user attr_accessible
but not the link_id
. The link_id
is inserted as NULL
.