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?
Zhao Yi wrote:
You have a nil object when you didn’t expect it!
The error occurred while evaluating nil.to_sym
贴出错误信æ¯å…¨æ–‡å¥½æŸ¥ä¸€ç‚¹.
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’