Partial works one time, not another
Working on "Shovell", I have gotten to the 2 index pages, Front Page and Upcoming Stories. The "Front Page" works fine. The "upcoming Stories" doesn't.
The problem lies in the _story.rhtml file.
This same file is used both by "index" (or Front Page) and "bin" or (upcoming stories). The only difference in code with the two controllers is the choice conditions for the sql. The "bin" then uses the index.rhtml file for output just like the "index".
<h3><%= link_to story.name,
story_url(:permalink => story.permalink) %></h3>
Submitted by: <%= story.user.login %> |
Score: <%= story.votes_count %>
Here is the result:
This is straight out of the book - Strange that it works one way and not the other. Does anyone have any answers to this problem?
Showing app/views/story/_story.rhtml where line #4 raised:
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.login
Extracted source (around line #4):
1: <div id="story">
2: <h3><%= link_to story.name, story_url(:permalink => story.permalink) %></h3>
4: Submitted by: <%= story.user.login %> |
5: Score: <%= story.votes_count %>