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
Mitch Malone
3,577 PointsUndefined method "full_name"
In Building Rails app > Customizing Forms > Navigation Links video at 2:57, the instructor puts in
<%= link_to current_user.full_name, "#" %>
It works in the video but not for me. I get an error:
undefined method `full_name' for nil:NilClass
2 Answers
Andy Brown
6,310 PointsWhen you get a nil:NilClass error, that means that the object, in this case current_user, is nil. So it doesn't have a full_name and the error occurs.
Mitch Malone
3,577 PointsSo I created another user. Refreshed. And "ta-da" it works. Awesome. Why? NO IDEA.
javier silverio
1,526 PointsThis worked for me!