Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


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