Last active
January 3, 2016 00:28
-
-
Save guinslym/8382480 to your computer and use it in GitHub Desktop.
Rails 3.2.16 I'm having this following error.
Can't mass-assign protected attributes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Profile < ActiveRecord::Base | |
attr_accessible :birthday, :name, :user_id | |
#association | |
belongs_to :user | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Profile.create(:name => 'John Doe', :password => 'secret', :created_at => Date.today, :updated_at => Date.today) | |
ActiveModel::MassAssignmentSecurity::Error: Can't mass-assign protected attributes: password, created_at, updated_at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
attr_accessible :email, :password | |
#association | |
has_one :profile | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
my model Profile needed to be updated