@story is nil but Story.find(:first) shows a result
I am working on Simply Rails 2. This problem occurs around page 346
I have several stories Story.find(first) returns
This is an extract from show.html.erb
#<Story id: 1, name: "Ogg invades", link: "http://climatecalm.org", created_at: "2009-07-18 10:44:51", updated_at: "2009-07-28 17:09:33", user_id: 1, votes_count: 3>
It gives the error:
Score: <%= @story.votes_count %>
<%= @story.name %>
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.votes_count
This page was working. Does anybody know what's happening?