Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


6,988 Points

Generating the Devise Views


Generating the Devise Views:

When I'm in the App/Models/user.erb my code stops working when I add the following code:

# Setup accessible (or protected) attributes for your model attr_accessible :email, :password, :password_confirmation, :remember_me, :first_name, :last_name, :profile_name # attr_accessible :title, :body end

I get the following error message:

attr_accessible is extracted out of Rails into a gem. Please use new recommended protection model for params(strong_parameters) or add protected_attributes to your Gemfile to use old one.

So I added the 'protected_attributes' gem to my Gemfile. This installed fine. However I'm still getting the same error message. Does anyone know how I could resolve this?



2 Answers

Brandon Barrette
Brandon Barrette
20,485 Points

Use Rails 3.2 like the videos or learn about strong parameters in Rails 4.

6,988 Points