In rails 3.2.1, I have a model:
class Player < ActiveRecord::Base
attr_accessor :password
attr_accessible :email, :password
attr_accessible :email, :password, :confirmed, :as => :admin
end
I keep getting a ActiveModel::MassAssignmentSecurity::Error
for the following:
params[:player]
#=> {:email => "[email protected]", :password => "12345", :confirmed => true)
player = Player.new(params[:player])
Why is this happening when all I want it to do is ignore the :confirmed
attribute and move on with it's business. The documentation makes it seem like I should be able to do that, but I keep getting this exception and it's really getting to me because either I am doing it wrong or the docs are wrong.
I'd love any help with this.