I created a scaffold and generated index, new, show, update, destory actions and its related views. When I open the index view, I will got the error: You have a nil object when you didn''t expect it! The error occurred while evaluating nil.to_sym Extracted source (around line #15): 12: <td><%=h db.project_name %></td> 13: <td><%=h db.db_project %></td> 14: <td><%=h db.db_product %></td> 15: <td><%= link_to ''Show'', db %></td> there is no problem for other controllers in this rails server. It seems that rails failed to request routing. Does anyone have this experience? -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Zhao Yi wrote:> > You have a nil object when you didn''t expect it! > The error occurred while evaluating nil.to_sym贴出错误信息全文好查一点. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Nanyang Zhan wrote:> Zhao Yi wrote: > >> >> You have a nil object when you didn''t expect it! >> The error occurred while evaluating nil.to_sym > > 贴出错误信息全文好查一点.The error track is shown below. /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/routing/route.rb:145:in `extra_keys'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/routing/route.rb:145:in `map'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/routing/route.rb:145:in `extra_keys'' generated code (/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/routing/route.rb:45):3:in `generate'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/routing/route_set.rb:338:in `generate'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/url_rewriter.rb:131:in `rewrite_path'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/url_rewriter.rb:110:in `rewrite_url'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/url_rewriter.rb:88:in `rewrite'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:622:in `url_for'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/helpers/url_helper.rb:71:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/helpers/url_helper.rb:71:in `url_for'' (eval):17:in `ddts_path'' app/views/ddts/index.html.erb:15:in `_run_erb_47app47views47ddts47index46html46erb'' app/views/ddts/index.html.erb:10:in `each'' app/views/ddts/index.html.erb:10:in `_run_erb_47app47views47ddts47index46html46erb'' app/controllers/ddts_controller.rb:7:in `index'' -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---