Welcome to the Treehouse Community
Looking to learn something new?
Brandon Mowat8,186 Points
undefined method `user'
Im getting this error at this point in the lesson.
undefined method `user' for #<Status:0x007fd8cb0cc820>
<code> <% @statuses.each do |status| %> <div class="status"> <strong><%= status.user.first_name %></strong> <p><%= status.content %></p> <div class="meta"> <%= link_to time_ago_in_words(status.created_at)+" ago", status %> </code>
I don't know why my status class doesn't have the method user.
Calvin Nix43,828 Points
This issue is caused because attr_accessible is no longer used in rails 4 because it is not secure. Rails 4 now uses Strong Parameters instead. Please refer to this link for references to how to implement these changes. This is actually discussed in later videos. I had this same issue when doing the rails course.