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 trialmatt67
14,205 Pointsundefined method `first_name' for #<User:
Hi folks,
I am working through this tutorial in Rails 4 and I will not be changing.
I have added the first_name, last_name and profile_name input fields to the new registrations page. However, I get the error message specified in the question title above. I think this is because there are no columns related to first_name and beyond in the User table. I think the solution to this problem is to add these columns to the user table but that begs the question, where is this step in the tutorial videos??? I know how to do this but where is the step in the videos??
If this is not the case, does devise work differently or what else could I be missing?
2 Answers
matt67
14,205 PointsI have found the answer. There is a step here: https://teamtreehouse.com/library/build-a-simple-ruby-on-rails-application/creating-an-authentication-system/generating-the-user-model whereby you specify these columns in the devise migration. My fault, I speeded through this step too quickly
Erik Dornblut
133 PointsHmm.. .I have the same problem but couldn't find it in the video you linked... I created this code: t.string :first_name t.string :last_name t.string :profile_name int the db / migrate / ...devise file but get the error anyways...
matt67
14,205 PointsIts around 4.07 in the video but if you have it already then I am not sure. Did you migrate the database?