I'm following practical rails social networking sites book. While creating a phoyo gallery, I've encountered this error:
NoMethodError in User_photos#show Showing user_photos/show.rhtml where line #2 raised: You have a nil object when you didn't expect it! The error occurred while evaluating nil.user Extracted source (around line #2): 1: <h3> 2: <%= link_to "#...@photo.user.username}'s Photos", 3: user_new_photo_path(:user_id => @photo.user) %> 4: </h3> 5: What should I do? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---