[Error][Rails 4] Undefined method `attr_accessible'

Hi Guy,

I’m a

  • beginner with Ruby on Rails.*I insert new colum

rails generate migration add_premium_to_jobs premium:boolean

after

rake db:migrate

And add in model -> job.rb ,the attribute* attr_accessible :premium*

Console error : undefined method `attr_accessible’

Can Help me?

Regards
Chikaawa

On Wednesday, August 13, 2014 9:23:53 PM UTC+1, Ricardo Liyushiro
Chikasawa
wrote:

And add in model -> job.rb ,the attribute* attr_accessible :premium*

Console error : undefined method `attr_accessible’

Can Help me?

attr_accessible and attr_protected were removed in rails 4. You can get
them back with the protected_attributes gem but the recommendation is to
use strong parameters instead.

Fred