in rails 2.3.11
, I have below in model
attr_accessor :person_id
and in controller
@project.person_id = current_user.id
now, I am converting this in rails 3.2.11
and I am getting
Can't mass-assign protected attributes: person_id
so I changed in model, I removed :person_id
from attr_accessor
and add below line
attr_accessible :person_id
but I am uisng person_id in controller, here it is
@project.person_id = current_user.id
I am getting this now
NoMethodError in ProjectsController#create
undefined method `person_id=' for #<Project:0x19cc51a>
any idea or help, How can I fix this? How can I handle both attr_accessor & attr_accessible?