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!

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


Authentication - Ruby

Hey I have problem with ruby authentication - devise.

I followed each step carefully with the videos. After I sign up for new user with my email and pass I get an error page.

Can't mass-assign protected attributes: email, password, password_confirmation

Does anyone knows what to do ?

Note: I'm using higher patch 3.2 ... something like this.

Also how does ruby connect to a database? There was no video saying how to configure connection to DB???

1 Answer

If anyone has this problem: I have solved it.

In your -> model -> user.rb look for line saying attr_accessible

Tom Studer
Tom Studer
8,098 Points

how did you solve it? I see:

devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable # attr_accessible :title, :body

Tom Studer
Tom Studer
8,098 Points

stackoverflow had the fix for devise, and I added :profile_name to it

attr_accessible :first_name, :last_name, :email, :profile_name, :password, :password_confirmation


Next video was a solve to this problem.

I raised a discussion before watching next video.

Thanks for replying

Tom Studer
Tom Studer
8,098 Points

I am learning that patience is a good thing. I am now watching the videos first before going through the steps instead of following along and working (pause + play). Now going back and re-watching all the videos to update my files.

Thank You!

I'm impatient too! Haha