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 trialTomasz Grabarczyk
4,860 PointsAuthentication - 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
Tomasz Grabarczyk
4,860 PointsIf anyone has this problem: I have solved it.
In your -> model -> user.rb look for line saying attr_accessible
Tom Studer
8,098 PointsTom Studer
8,098 Pointshow did you solve it? I see:
devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable # attr_accessible :title, :body
Tom Studer
8,098 PointsTom Studer
8,098 Pointsstackoverflow had the fix for devise, and I added :profile_name to it
attr_accessible :first_name, :last_name, :email, :profile_name, :password, :password_confirmation
Tomasz Grabarczyk
4,860 PointsTomasz Grabarczyk
4,860 PointsHey
Next video was a solve to this problem.
I raised a discussion before watching next video.
Thanks for replying
Tom Studer
8,098 PointsTom Studer
8,098 PointsI 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!
Tomasz Grabarczyk
4,860 PointsTomasz Grabarczyk
4,860 PointsI'm impatient too! Haha