Undefined local variable or method `new_new_path' in an scaffold

Hi there people.

My problem come after creating an scaffold like

$ script/generate scaffold New title:string content:text

I dont know what is the possible cause for this, so when I go to
http://127.0.0.1:3000/news I get this error:

######################################################################
NameError in News#index

Showing news/index.html.erb where line #22 raised:

undefined local variable or method `new_new_path’ for
#ActionView::Base:0xb6fcc4a0

Extracted source (around line #22):

19:
20:

21:
22: <%= link_to ‘New new’, new_new_path %>

RAILS_ROOT: /svn/catalogo
Application Trace | Framework Trace | Full Trace

app/views/news/index.html.erb:22:in
_run_erb_47app47views47news47index46html46erb' app/controllers/news_controller.rb:7:inindex’

vendor/rails/actionpack/lib/action_view/base.rb:338:in send' vendor/rails/actionpack/lib/action_view/base.rb:338:inexecute’
vendor/rails/actionpack/lib/action_view/template_handlers/
compilable.rb:29:in send' vendor/rails/actionpack/lib/action_view/template_handlers/ compilable.rb:29:inrender’
vendor/rails/actionpack/lib/action_view/template.rb:35:in render' vendor/rails/actionpack/lib/action_view/template.rb:22:inrender_template’
vendor/rails/actionpack/lib/action_view/base.rb:245:in render_file' vendor/rails/actionpack/lib/action_controller/base.rb:1108:inrender_for_file’
vendor/rails/actionpack/lib/action_controller/base.rb:865:in
render_with_no_layout' vendor/rails/actionpack/lib/action_controller/base.rb:880:inrender_with_no_layout’
vendor/rails/actionpack/lib/action_controller/layout.rb:251:in
render_without_benchmark' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:inrender’
vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:
8:in realtime' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:inrender’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:131:in
send' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:131:incustom’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:160:in
call' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:160:inrespond’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:154:in
each' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:154:inrespond’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:107:in
respond_to' vendor/rails/actionpack/lib/action_controller/base.rb:1162:insend’
vendor/rails/actionpack/lib/action_controller/base.rb:1162:in
perform_action_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:580:incall_filters’
vendor/rails/actionpack/lib/action_controller/filters.rb:573:in
perform_action_without_benchmark' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue’
vendor/rails/actionpack/lib/action_controller/rescue.rb:201:in
perform_action_without_caching' vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb: 13:inperform_action’
vendor/rails/activerecord/lib/active_record/connection_adapters/
abstract/query_cache.rb:33:in cache' vendor/rails/activerecord/lib/active_record/query_cache.rb:8:incache’
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:
12:in perform_action' vendor/rails/actionpack/lib/action_controller/base.rb:529:insend’
vendor/rails/actionpack/lib/action_controller/base.rb:529:in
process_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:569:inprocess_without_session_management_support’
vendor/rails/actionpack/lib/action_controller/session_management.rb:
130:in process' vendor/rails/actionpack/lib/action_controller/base.rb:389:inprocess’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:149:in
handle_request' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:107:indispatch’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in
synchronize' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:indispatch’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:120:in
dispatch_cgi' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:indispatch’
vendor/rails/railties/lib/webrick_server.rb:112:in handle_dispatch' vendor/rails/railties/lib/webrick_server.rb:78:inservice’
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:inrun’
/usr/lib/ruby/1.8/webrick/server.rb:173:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:instart’
/usr/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:instart’
/usr/lib/ruby/1.8/webrick/server.rb:92:in each' /usr/lib/ruby/1.8/webrick/server.rb:92:instart’
/usr/lib/ruby/1.8/webrick/server.rb:23:in start' /usr/lib/ruby/1.8/webrick/server.rb:82:instart’
vendor/rails/railties/lib/webrick_server.rb:62:in dispatch' vendor/rails/railties/lib/commands/servers/webrick.rb:66 /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in require' vendor/rails/activesupport/lib/active_support/dependencies.rb:509:inrequire’
vendor/rails/activesupport/lib/active_support/dependencies.rb:354:in
new_constants_in' vendor/rails/activesupport/lib/active_support/dependencies.rb:509:inrequire’
vendor/rails/railties/lib/commands/server.rb:39
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire’
script/server:3

app/views/news/index.html.erb:22:in
_run_erb_47app47views47news47index46html46erb' vendor/rails/actionpack/lib/action_view/base.rb:338:insend’
vendor/rails/actionpack/lib/action_view/base.rb:338:in execute' vendor/rails/actionpack/lib/action_view/template_handlers/ compilable.rb:29:insend’
vendor/rails/actionpack/lib/action_view/template_handlers/
compilable.rb:29:in render' vendor/rails/actionpack/lib/action_view/template.rb:35:inrender’
vendor/rails/actionpack/lib/action_view/template.rb:22:in
render_template' vendor/rails/actionpack/lib/action_view/base.rb:245:inrender_file’
vendor/rails/actionpack/lib/action_controller/base.rb:1108:in
render_for_file' vendor/rails/actionpack/lib/action_controller/base.rb:865:inrender_with_no_layout’
vendor/rails/actionpack/lib/action_controller/base.rb:880:in
render_with_no_layout' vendor/rails/actionpack/lib/action_controller/layout.rb:251:inrender_without_benchmark’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in
render' vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb: 8:inrealtime’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in
render' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:131:insend’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:131:in
custom' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:160:incall’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:160:in
respond' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:154:ineach’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:154:in
respond' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:107:inrespond_to’
app/controllers/news_controller.rb:7:in index' vendor/rails/actionpack/lib/action_controller/base.rb:1162:insend’
vendor/rails/actionpack/lib/action_controller/base.rb:1162:in
perform_action_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:580:incall_filters’
vendor/rails/actionpack/lib/action_controller/filters.rb:573:in
perform_action_without_benchmark' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue’
vendor/rails/actionpack/lib/action_controller/rescue.rb:201:in
perform_action_without_caching' vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb: 13:inperform_action’
vendor/rails/activerecord/lib/active_record/connection_adapters/
abstract/query_cache.rb:33:in cache' vendor/rails/activerecord/lib/active_record/query_cache.rb:8:incache’
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:
12:in perform_action' vendor/rails/actionpack/lib/action_controller/base.rb:529:insend’
vendor/rails/actionpack/lib/action_controller/base.rb:529:in
process_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:569:inprocess_without_session_management_support’
vendor/rails/actionpack/lib/action_controller/session_management.rb:
130:in process' vendor/rails/actionpack/lib/action_controller/base.rb:389:inprocess’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:149:in
handle_request' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:107:indispatch’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in
synchronize' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:indispatch’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:120:in
dispatch_cgi' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:indispatch’
vendor/rails/railties/lib/webrick_server.rb:112:in handle_dispatch' vendor/rails/railties/lib/webrick_server.rb:78:inservice’
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:inrun’
/usr/lib/ruby/1.8/webrick/server.rb:173:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:instart’
/usr/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:instart’
/usr/lib/ruby/1.8/webrick/server.rb:92:in each' /usr/lib/ruby/1.8/webrick/server.rb:92:instart’
/usr/lib/ruby/1.8/webrick/server.rb:23:in start' /usr/lib/ruby/1.8/webrick/server.rb:82:instart’
vendor/rails/railties/lib/webrick_server.rb:62:in dispatch' vendor/rails/railties/lib/commands/servers/webrick.rb:66 /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in require' vendor/rails/activesupport/lib/active_support/dependencies.rb:509:inrequire’
vendor/rails/activesupport/lib/active_support/dependencies.rb:354:in
new_constants_in' vendor/rails/activesupport/lib/active_support/dependencies.rb:509:inrequire’
vendor/rails/railties/lib/commands/server.rb:39
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire’
script/server:3

Request

Parameters:

None

Show session dump


user_credentials:
e80ccd0df823931b60f05b220c5c3b30011dd4a83687871794bc1b04fd4a5f4fc6a3c823366ab80747139a72cdc26b1801109357a57e6474bb07d6a1fc21afd9
:csrf_id: 6b5ad68708dd57c6e2434bfbd71f3438
:return_to:
user_credentials_id: 1
flash: !map:ActionController::Flash::FlashHash {}

Response

Headers:

{“Content-Type”=>“text/html”,
“cookie”=>[],
“Cache-Control”=>“no-cache”}

######################################################################

On Thu, 2009-10-01 at 16:56 -0700, tyoc wrote:

Hi there people.

My problem come after creating an scaffold like

$ script/generate scaffold New title:string content:text

I dont know what is the possible cause for this, so when I go to
http://127.0.0.1:3000/news I get this error:

Pick another name for your model. ‘new’ has meaning to Rails.

HTH,
Bill

That is, I have selected to map another name as news for have a “news”
route.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs