Welcome to the Treehouse Community
Looking to learn something new?
Now that attr_accessible is not valid, in Rails 4. How should we modify the code
I have modified the device user migration, added first_name, last_name and profile_name, modified the devise views, so that it will be able to accomodate the above fields. But I am unable to the attr_accessible, since it is not allowed, so first_name, last_name and profile_name are going to nil in the console. Any help will be greatly appreciated. Thanks
class User < ActiveRecord::Base # Include default devise modules. Others available are: # :token_authenticatable, :confirmable, # :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable # Setup accessible (or protected) attributes for your model attr_accessible :email, :password, :password_confirmation, :remember_me # attr_accessible :title, :body end
You wouldn't use
attr_ anything in Rails 4. But really, dude, your first port of call should be google. And there is plenty there is you just google "Rails 4 attr_accessible": https://www.google.es/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=rails%204%20attr_accessible