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
Michael Leonard
866 Pointsundefined method `first_name' for nil:NilClass
Hi,
Im receiving this error even after reseting the db and deleting all users and statuses. Can seem to find the issue.
Any help is appreciated. Thanks!
3 Answers
Michael Leonard
866 Pointsinstead of calling status.user.first_name in index.erb i changed it to full_name and now im getting this error:
undefined method `user' for nil:NilClass
Rodrigo Soares
2,460 PointsMichael you should provide us with more information so we can help you.
What project are you developing? Treebook?
You should copy your user controller and model in here.
Maciej Czuchnowski
36,441 PointsI'm 99% sure this is because you are using Rails 4 and not 3 (there are significant differences that prevent you from following this project line by line with Rails 4). What does your Gemfile say? It has the line with gem 'rails' and rails version follows. If it's 4.0, there's your culprit.