A problem about routing request


#1

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:

<%=h db.project_name %>
13: <%=h db.db_project %>
14: <%=h db.db_product %>
15: <%= link_to ‘Show’, db %>

there is no problem for other controllers in this rails server. It seems
that rails failed to request routing. Does anyone have this experience?


#2

Zhao Yi wrote:

You have a nil object when you didn’t expect it!
The error occurred while evaluating nil.to_sym

贴出错误信息全文好查一点.


#3

Nanyang Z. 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:inmap’
/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:ingenerate’
/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:inrewrite_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:inrewrite’
/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:insend’
/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:inddts_path’
app/views/ddts/index.html.erb:15:in
_run_erb_47app47views47ddts47index46html46erb' app/views/ddts/index.html.erb:10:ineach’
app/views/ddts/index.html.erb:10:in
_run_erb_47app47views47ddts47index46html46erb' app/controllers/ddts_controller.rb:7:inindex’