Forum: Ruby on Rails A problem about routing request

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Zhao Y. (Guest)
on 2009-03-31 14:53
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?
Nanyang Z. (Guest)
on 2009-03-31 17:15
Zhao Yi wrote:

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

贴出错误信息全文好查一点.
Zhao Y. (Guest)
on 2009-04-01 04:51
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: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'
This topic is locked and can not be replied to.