ruby on rails - Mass-assignment issue -
please, explain, how can make records in database several methods, changing attributes don't want attr_accessible
.
for example, in user model:
attr_accessible :email, :password, :password_confirmation, :guest
i don't want 'admin' true or false row placed here because of security issue
you can assign attribute manually, example if model named user can following :
user = user.first user.update_attributes(attributes_hash) user.admin = true user.save
attr_accessible used mass assignment via update_attributes example, can assign specific property calling directly in example above.
Comments
Post a Comment