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

Ruby

no method error in statuses#index problem please help

I have followed everything to a T even going back to the beginning of the course has anybody had this problem? If so please help me solve it NoMethodError in Statuses#index

Showing C:/Usersr/Documents/Applications/treebook/app/views/statuses/index.html.erb where line #9 raised:

undefined method `full_name' for nil:NilClass Extracted source (around line #9):

6:
7: <% @statuses.each do |status| %> 8: <div class="status"> 9: <strong><%= status.user.full_name %></strong> 10: <p><%= status.content %></p> 11: <div class="meta"> 12: <%= link_to time_ago_in_words(status.created_at) + " ago", status %> | Rails.root: C:/Users/Documents/Applications/treebook

Application Trace | Framework Trace | Full Trace app/views/statuses/index.html.erb:9:in block in _app_views_statuses_index_html_erb__236845067_29072820' app/views/statuses/index.html.erb:7:ineach' app/views/statuses/index.html.erb:7:in _app_views_statuses_index_html_erb__236845067_29072820' app/controllers/statuses_controller.rb:7:inindex'NoMethodError in Statuses#index

Showing C:/Users/Documents/Applications/treebook/app/views/statuses/index.html.erb where line #9 raised:

undefined method `full_name' for nil:NilClass Extracted source (around line #9):

6:
7: <% @statuses.each do |status| %> 8: <div class="status"> 9: <strong><%= status.user.full_name %></strong> 10: <p><%= status.content %></p> 11: <div class="meta"> 12: <%= link_to time_ago_in_words(status.created_at) + " ago", status %> | Rails.root: C:/Users/Documents/Applications/treebook

Application Trace | Framework Trace | Full Trace app/views/statuses/index.html.erb:9:in block in _app_views_statuses_index_html_erb__236845067_29072820' app/views/statuses/index.html.erb:7:ineach' app/views/statuses/index.html.erb:7:in _app_views_statuses_index_html_erb__236845067_29072820' app/controllers/statuses_controller.rb:7:inindex'

Problem solved

2 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Robert Borsey, sorry for the trouble! Jim fixes that issue in the following video:

http://teamtreehouse.com/library/programming-2/build-a-simple-version-of-facebook/customizing-forms/getting-the-latest-changes

Try following along there and let us know if you still have problems.

Jason thank you for answering, You didn't see the other part of the post. But I did get it fixed a lot of people where having the same problem. I love these courses makes me think and want to solve the problems I run into myself even the stupid little ones. lol that's when you don't forget.