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
Prosper Hughie
5,086 PointsI need some help with my ruby on rails application
I am following along with the ruby on rails tutorial. I am at the point where i can get to the sign_up page but when i click sign_up, i get this error:
ActiveModel::MassAssignmentSecurity::Error in Devise::RegistrationsController#create
Can't mass-assign protected attributes: email, password, password_confirmation
{"utf8"=>"?",
"authenticity_token"=>"yEcNIsbuzGc44hS+T19eq/YOTB8BSbv1g2GG8luDL+4=",
"user"=>{"email"=>"",
"password"=>"[FILTERED]",
"password_confirmation"=>"[FILTERED]"},
"commit"=>"Sign up"}
Any ideas why this is happening. I need to resolve this issue to i can move on. Thanks!
2 Answers
Jonathan Amat
4,651 PointsDid you try going to the user.rb file and adding :email, :password, and :password_confirmation to attr_accessibile?
Mohsen Qaddoura
22,237 Pointsyour problem and its solution is in this video tutorial on Treehouse itself!
here is the link:
I also had trouble even after following the video,so I also added this gem to the application gem file (after the devise gem ) :
gem 'protected_attributes'
then you have to : 1-stop your rails server (using ctrl +c) from the console> :2- run bundle on the command line to install the above mentioned gem.
When you restart the rails server and refresh the page in the browser this error will disappear,but the next error mentioned in the video will show up , so you just follow the instructions given again and you should be fine.
Prosper Hughie
5,086 PointsProsper Hughie
5,086 PointsI tried this and it didn't work. ); Any other ideas?