I am getting this error message, although I have checked the
show.rhtml file and the corresponding controller file, when trying to
look at my new permalink. Any advice/help would be appreciated.
Thanks!
----
NoMethodError in Story#show
Showing app/views/story/show.rhtml where line #1 raised:
You have a nil object when you didn''t expect it!
The error occurred while evaluating nil.name
Extracted source (around line #1):
1: <h2><%= @story.name %></h2>
2: <p><%= link_to @story.link, @story.link %></p>
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/app/views/story/show.rhtml:1:in
`_run_rhtml_47app47views47story47show46rhtml''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
base.rb:326:in `send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
base.rb:326:in `compile_and_render_template''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
base.rb:301:in `render_template''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
base.rb:260:in `render_file''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:806:in `render_file''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:711:in `render_with_no_layout''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/layout.rb:247:in `render_without_benchmark''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/benchmarking.rb:50:in `render''
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/benchmarking.rb:50:in `render''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:1096:in `perform_action_without_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/filters.rb:632:in `call_filter''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/filters.rb:619:in `perform_action_without_benchmark''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/benchmarking.rb:66:in
`perform_action_without_rescue''
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/benchmarking.rb:66:in
`perform_action_without_rescue''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/rescue.rb:83:in `perform_action''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:430:in `send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:430:in `process_without_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/filters.rb:624:in
`process_without_session_management_support''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/session_management.rb:114:in `process''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:330:in `process''
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/dispatcher.rb:41:in
`dispatch''
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
113:in `handle_dispatch''
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
79:in `service''
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service''
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''
/usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread''
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start''
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread''
/usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start''
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each''
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start''
/usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start''
/usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start''
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
63:in `dispatch''
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/servers/
webrick.rb:59
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require''
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require''
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
active_support/dependencies.rb:495:in `require''
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
active_support/dependencies.rb:342:in `new_constants_in''
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
active_support/dependencies.rb:495:in `require''
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:
39
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require''
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require''
script/server:3
#{RAILS_ROOT}/app/views/story/show.rhtml:1:in
`_run_rhtml_47app47views47story47show46rhtml''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
base.rb:326:in `send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
base.rb:326:in `compile_and_render_template''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
base.rb:301:in `render_template''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
base.rb:260:in `render_file''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:806:in `render_file''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:711:in `render_with_no_layout''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/layout.rb:247:in `render_without_benchmark''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/benchmarking.rb:50:in `render''
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/benchmarking.rb:50:in `render''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:1096:in `perform_action_without_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/filters.rb:632:in `call_filter''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/filters.rb:619:in `perform_action_without_benchmark''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/benchmarking.rb:66:in
`perform_action_without_rescue''
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/benchmarking.rb:66:in
`perform_action_without_rescue''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/rescue.rb:83:in `perform_action''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:430:in `send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:430:in `process_without_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/filters.rb:624:in
`process_without_session_management_support''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/session_management.rb:114:in `process''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:330:in `process''
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/dispatcher.rb:41:in
`dispatch''
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
113:in `handle_dispatch''
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
79:in `service''
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service''
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''
/usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread''
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start''
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread''
/usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start''
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each''
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start''
/usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start''
/usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start''
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
63:in `dispatch''
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/servers/
webrick.rb:59
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require''
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require''
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
active_support/dependencies.rb:495:in `require''
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
active_support/dependencies.rb:342:in `new_constants_in''
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
active_support/dependencies.rb:495:in `require''
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:
39
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require''
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require''
script/server:3
Request
Parameters: {"permalink"=>"my-shiny-weblog"}
Show session dump
---
flash: !map:ActionController::Flash::FlashHash {}
Response
Headers: {"cookie"=>[],
"Cache-Control"=>"no-cache"}
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Um, @story is nil. You''ll have to post the controller code for any help. Jason On 4/10/07, Zak <zacharykidd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > I am getting this error message, although I have checked the > show.rhtml file and the corresponding controller file, when trying to > look at my new permalink. Any advice/help would be appreciated. > Thanks! > > ---- > > > NoMethodError in Story#show > > Showing app/views/story/show.rhtml where line #1 raised: > > You have a nil object when you didn''t expect it! > The error occurred while evaluating nil.name > > Extracted source (around line #1): > > 1: <h2><%= @story.name %></h2> > 2: <p><%= link_to @story.link, @story.link %></p> > > RAILS_ROOT: script/../config/.. > Application Trace | Framework Trace | Full Trace > > #{RAILS_ROOT}/app/views/story/show.rhtml:1:in > `_run_rhtml_47app47views47story47show46rhtml'' > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ > base.rb:326:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ > base.rb:326:in `compile_and_render_template'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ > base.rb:301:in `render_template'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ > base.rb:260:in `render_file'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/base.rb:806:in `render_file'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/base.rb:711:in `render_with_no_layout'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/layout.rb:247:in `render_without_benchmark'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/benchmarking.rb:50:in `render'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/benchmarking.rb:50:in `render'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/base.rb:1096:in `perform_action_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/filters.rb:632:in `call_filter'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/filters.rb:619:in `perform_action_without_benchmark'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/benchmarking.rb:66:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/benchmarking.rb:66:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/rescue.rb:83:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/base.rb:430:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/base.rb:430:in `process_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/filters.rb:624:in > `process_without_session_management_support'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/session_management.rb:114:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/base.rb:330:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/dispatcher.rb:41:in > `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb: > 113:in `handle_dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb: > 79:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb: > 63:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/servers/ > webrick.rb:59 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/ > active_support/dependencies.rb:495:in `require'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/ > active_support/dependencies.rb:342:in `new_constants_in'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/ > active_support/dependencies.rb:495:in `require'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb: > 39 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > script/server:3 > > #{RAILS_ROOT}/app/views/story/show.rhtml:1:in > `_run_rhtml_47app47views47story47show46rhtml'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ > base.rb:326:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ > base.rb:326:in `compile_and_render_template'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ > base.rb:301:in `render_template'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/ > base.rb:260:in `render_file'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/base.rb:806:in `render_file'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/base.rb:711:in `render_with_no_layout'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/layout.rb:247:in `render_without_benchmark'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/benchmarking.rb:50:in `render'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/benchmarking.rb:50:in `render'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/base.rb:1096:in `perform_action_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/filters.rb:632:in `call_filter'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/filters.rb:619:in `perform_action_without_benchmark'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/benchmarking.rb:66:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/benchmarking.rb:66:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/rescue.rb:83:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/base.rb:430:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/base.rb:430:in `process_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/filters.rb:624:in > `process_without_session_management_support'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/session_management.rb:114:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ > action_controller/base.rb:330:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/dispatcher.rb:41:in > `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb: > 113:in `handle_dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb: > 79:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb: > 63:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/servers/ > webrick.rb:59 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/ > active_support/dependencies.rb:495:in `require'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/ > active_support/dependencies.rb:342:in `new_constants_in'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/ > active_support/dependencies.rb:495:in `require'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb: > 39 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > script/server:3 > > Request > > Parameters: {"permalink"=>"my-shiny-weblog"} > > Show session dump > > --- > flash: !map:ActionController::Flash::FlashHash {} > > > Response > Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''ve been back tracking all my work. Now I am getting a Routing Error
looking like this: Routing Error
no route found to match "/story/new/show/my-shiny-weblog" with
{:method=>:get}
And my controller looks like this:
class StoryController < ApplicationController
def index
@story = Story.find(:first, :order => ''RAND()'')
end
def new
@story = Story.new(params[:story])
if request.post? and @story.save
flash[:notice] = ''Story submission succeeded''
redirect_to :action => ''index''
end
end
def show
@story = Story.find_by_permalink(params[:permalink])
end
end
--------
On Apr 10, 11:25 am, "Jason Roelofs"
<jameskil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Um, @story is nil.
>
> You''ll have to post the controller code for any help.
>
> Jason
>
> On 4/10/07, Zak <zacharyk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
>
>
>
> > I am getting this error message, although I have checked the
> > show.rhtml file and the corresponding controller file, when trying to
> > look at my new permalink. Any advice/help would be appreciated.
> > Thanks!
>
> > ----
>
> > NoMethodError in Story#show
>
> > Showing app/views/story/show.rhtml where line #1 raised:
>
> > You have a nil object when you didn''t expect it!
> > The error occurred while evaluating nil.name
>
> > Extracted source (around line #1):
>
> > 1: <h2><%= @story.name %></h2>
> > 2: <p><%= link_to @story.link, @story.link %></p>
>
> > RAILS_ROOT: script/../config/..
> > Application Trace | Framework Trace | Full Trace
>
> > #{RAILS_ROOT}/app/views/story/show.rhtml:1:in
> > `_run_rhtml_47app47views47story47show46rhtml''
>
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
> > base.rb:326:in `send''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
> > base.rb:326:in `compile_and_render_template''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
> > base.rb:301:in `render_template''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
> > base.rb:260:in `render_file''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/base.rb:806:in `render_file''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/base.rb:711:in `render_with_no_layout''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/layout.rb:247:in `render_without_benchmark''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/benchmarking.rb:50:in `render''
> > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/benchmarking.rb:50:in `render''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/base.rb:1096:in
`perform_action_without_filters''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/filters.rb:632:in `call_filter''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/filters.rb:619:in
`perform_action_without_benchmark''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/benchmarking.rb:66:in
> > `perform_action_without_rescue''
> > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/benchmarking.rb:66:in
> > `perform_action_without_rescue''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/rescue.rb:83:in `perform_action''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/base.rb:430:in `send''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/base.rb:430:in `process_without_filters''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/filters.rb:624:in
> > `process_without_session_management_support''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/session_management.rb:114:in `process''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/base.rb:330:in `process''
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/dispatcher.rb:41:in
> > `dispatch''
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
> > 113:in `handle_dispatch''
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
> > 79:in `service''
> > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in
`service''
> > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:173:in
`start_thread''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in
`start_thread''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start''
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
> > 63:in `dispatch''
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/servers/
> > webrick.rb:59
> > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `gem_original_require''
> > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `require''
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
> > active_support/dependencies.rb:495:in `require''
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
> > active_support/dependencies.rb:342:in `new_constants_in''
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
> > active_support/dependencies.rb:495:in `require''
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:
> > 39
> > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `gem_original_require''
> > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `require''
> > script/server:3
>
> > #{RAILS_ROOT}/app/views/story/show.rhtml:1:in
> > `_run_rhtml_47app47views47story47show46rhtml''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
> > base.rb:326:in `send''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
> > base.rb:326:in `compile_and_render_template''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
> > base.rb:301:in `render_template''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/
> > base.rb:260:in `render_file''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/base.rb:806:in `render_file''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/base.rb:711:in `render_with_no_layout''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/layout.rb:247:in `render_without_benchmark''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/benchmarking.rb:50:in `render''
> > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/benchmarking.rb:50:in `render''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/base.rb:1096:in
`perform_action_without_filters''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/filters.rb:632:in `call_filter''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/filters.rb:619:in
`perform_action_without_benchmark''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/benchmarking.rb:66:in
> > `perform_action_without_rescue''
> > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/benchmarking.rb:66:in
> > `perform_action_without_rescue''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/rescue.rb:83:in `perform_action''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/base.rb:430:in `send''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/base.rb:430:in `process_without_filters''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/filters.rb:624:in
> > `process_without_session_management_support''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/session_management.rb:114:in `process''
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
> > action_controller/base.rb:330:in `process''
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/dispatcher.rb:41:in
> > `dispatch''
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
> > 113:in `handle_dispatch''
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
> > 79:in `service''
> > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in
`service''
> > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:173:in
`start_thread''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in
`start_thread''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start''
> > /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start''
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
> > 63:in `dispatch''
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/servers/
> > webrick.rb:59
> > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `gem_original_require''
> > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `require''
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
> > active_support/dependencies.rb:495:in `require''
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
> > active_support/dependencies.rb:342:in `new_constants_in''
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
> > active_support/dependencies.rb:495:in `require''
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:
> > 39
> > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `gem_original_require''
> > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `require''
> > script/server:3
>
> > Request
>
> > Parameters: {"permalink"=>"my-shiny-weblog"}
>
> > Show session dump
>
> > ---
> > flash: !map:ActionController::Flash::FlashHash {}
>
> > Response
> > Headers: {"cookie"=>[],
"Cache-Control"=>"no-cache"}
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---