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

Errors after 'Creating Relationships'

Perhaps I missed something, and I have reviewed this video and the one prior to it a few times today. I feel like I've done everything according to what Jim has done, but I can't get things to work the same way. Or at least that's what it seems like.

NoMethodError in Statuses#index

Showing C:/Sites/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" %>

Perhaps someone else has mentioned this error, but the forum somewhat difficult to search through. If I might suggest a way to post questions per video, rather than have them all in one forum? That would be a help.

7 Answers

Good luck

Good luck

None of this helped, and actually I think I just made it worse. Awesome.

Keep trying man, you'll figure it out soon.

Charles - In general on a forum you shouldn't post bare links as it's little better than using the passive-aggressive service lmgtfy.com.

Thanks for the info, James Barnett! :)

I've worked through the project again, from the start, and have found my error.

What happened was that although I had deleted users through the app they were not being deleted in the index (so it's not equivalent to deleting users through the Ruby console). So even though there was only one official "registered user", I kept entering user "1", which there was no user 1, it had been deleted, really I was more like user 9. Hope that's news you can use for any other perplexed soul out there.