Hello,

I am in the "Showing off our Stories" section on page 198 in Lenz's book.

When I enter this url http://localhost:3000/story/show/my-shiny-weblog I get the correct page.

After the previous code and test I added:

<%= link_to @story.name,
story_url( ermalink => @story.permalink) %> (I don't know why a smilie icon shows up at these places)

to the index.rhtml page and got an error page after browsing to http://localhost:3000/story/

Instead of getting:
Shovell
A random link: Sitepont Forums,

I got:

ActionController::RoutingError in Story#index
Showing app/views/story/index.rhtml where line #3 raised:

story_url failed to generate from {:action=>"show", :controller=>"story", ermalink=>nil}, expected: {:controller=>"story", :action=>"show"}, diff: {ermalink=>nil} (I don't know why a smilie icon shows up at these places)

Extracted source (around line #3):

1: A random link:
2: <%= link_to @story.name,
3: story_url( ermalink => @story.permalink) %> (I don't know why a smilie icon shows up at these places)


RAILS_ROOT: ./script/../config/..

Application Trace | Framework Trace | Full Trace
C:/InstantRails/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/routing.rb:1306:in `raise_named_route_error'
C:/InstantRails/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/routing.rb:1278:in `generate'
C:/InstantRails/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/url_rewriter.rb:107:in `rewrite_path'
C:/InstantRails/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/url_rewriter.rb:70:in `rewrite'
C:/InstantRails/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:527:in `url_for'
C:/InstantRails/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_view/helpers/url_helper.rb:27:in `send'
C:/InstantRails/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_view/helpers/url_helper.rb:27:in `url_for'
(eval):19:in `story_url'
C:/InstantRails/InstantRails/rails_apps/shovell/app/views/story/index.rhtml:3:in `_run_rhtml_47app47views47story47index46rhtml'

But A funny thing happens. When I click the refresh button 4 or 5 times the correct page displays.

Am I missing something. Is there some way to fix this? Your help would be much appreciated.

Thanks,
Walter
Code HTML4Strict: