# Simple Generated Component Suddenly Gives Errors

**URL:** <https://www.ruby-forum.com/t/simple-generated-component-suddenly-gives-errors/137110>\
**Category:** Rails\
**Created:** [May 9, 2008, 12:22am UTC](https://www.ruby-forum.com/t/simple-generated-component-suddenly-gives-errors/137110 "2008-05-09T00:22:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [May 9, 2008, 12:22am UTC](https://www.ruby-forum.com/t/simple-generated-component-suddenly-gives-errors/137110/1 "2008-05-09T00:22:32Z")

</div>

What am I doing wrong here when I wrote a very simple component so :

C:\ruby\letter4sure\>ruby script\generate scaffold pso\_printers  
printing\_setting\_id:integer pso\_id:integer  
exists app/models/  
exists app/controllers/  
exists app/helpers/  
create app/views/pso\_printers  
…

Then I did a rake db:migrate

And then I simply went to take a look at the url for the above :

[http://localhost](http://localhost):port/pso\_printers

NameError in Pso\_printers#index

Showing pso\_printers/index.html.erb where line #22 raised:

undefined local variable or method `new\_pso\_printers\_path’ for  
#ActionView::Base:0x4c345e8

Extracted source (around line #22):

19:  
20:   
  
21:  
22: \<%= link\_to ‘New pso\_printers’, new\_pso\_printers\_path %\>

RAILS\_ROOT: C:/ruby/letter4sure  
Application Trace | Framework Trace | Full Trace

app/views/pso\_printers/index.html.erb:22:in  
`_run_erb_47app47views47pso_printers47index46html46erb' app/controllers/pso_printers_controller.rb:8:in `index’  
-e:2:in `load’  
-e:2

c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_view/base.rb:637:in  
`send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in `compile\_and\_render\_template’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_view/base.rb:365:in  
`render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:316:in `render\_file’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:1100:in  
`render_for_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:858:in `render\_with\_no\_layout’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:872:in  
`render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/layout.rb:262:in `render\_without\_benchmark’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/benchmarking.rb:51:in  
`render_without_active_scaffold' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/benchmarking.rb:51:in  
`render_without_active_scaffold' vendor/plugins/active_scaffold/lib/extensions/action_controller_rendering.rb:13:in `render’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/mime\_responds.rb:131:in  
`send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/mime_responds.rb:131:in `custom’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/mime\_responds.rb:156:in  
`call' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/mime_responds.rb:156:in `respond’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/mime\_responds.rb:150:in  
`each' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/mime_responds.rb:150:in `respond’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/mime\_responds.rb:107:in  
`respond_to' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `send’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:1158:in  
`perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call\_filters’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/filters.rb:689:in  
`perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform\_action\_without\_rescue’  
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform\_action\_without\_rescue’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/rescue.rb:199:in  
`perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform\_action’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active\_record/connection\_adapters/abstract/query\_cache.rb:33:in  
`cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/caching.rb:677:in  
`perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:524:in  
`process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process\_without\_session\_management\_support’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/session\_management.rb:123:in  
`process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/dispatcher.rb:171:in  
`handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/dispatcher.rb:126:in  
`dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/rails.rb:76:in  
`process' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/rails.rb:74:in `synchronize’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/rails.rb:74:in  
`process' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:159:in `process\_client’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:158:in  
`each' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:158:in `process\_client’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in `initialize’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in  
`new' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in `run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:268:in  
`initialize' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:268:in `new’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:268:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/configurator.rb:282:in `run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/configurator.rb:281:in  
`each' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/configurator.rb:281:in `run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/mongrel\_rails:128:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/command.rb:212:in `run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/mongrel\_rails:281  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:489:in  
`load' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load’  
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/mongrel.rb:64  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:496:in  
`require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new\_constants\_in’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:496:in  
`require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem\_original\_require’  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require’  
script/server:3

app/views/pso\_printers/index.html.erb:22:in  
`_run_erb_47app47views47pso_printers47index46html46erb' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in `send’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_view/base.rb:637:in  
`compile_and_render_template' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in `render\_template’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_view/base.rb:316:in  
`render_file' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in `render\_for\_file’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:858:in  
`render_with_no_layout' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:872:in `render\_with\_no\_layout’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/layout.rb:262:in  
`render_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render\_without\_active\_scaffold’  
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in `render\_without\_active\_scaffold’  
vendor/plugins/active\_scaffold/lib/extensions/action\_controller\_rendering.rb:13:in  
`render' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/mime_responds.rb:131:in `send’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/mime\_responds.rb:131:in  
`custom' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/mime_responds.rb:156:in `call’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/mime\_responds.rb:156:in  
`respond' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/mime_responds.rb:150:in `each’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/mime\_responds.rb:150:in  
`respond' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/mime_responds.rb:107:in `respond\_to’  
app/controllers/pso\_printers\_controller.rb:8:in `index' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `send’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:1158:in  
`perform_action_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call\_filters’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/filters.rb:689:in  
`perform_action_without_benchmark' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform\_action\_without\_rescue’  
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform\_action\_without\_rescue’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/rescue.rb:199:in  
`perform_action_without_caching' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform\_action’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active\_record/connection\_adapters/abstract/query\_cache.rb:33:in  
`cache' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/caching.rb:677:in  
`perform_action' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:524:in  
`process_without_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process\_without\_session\_management\_support’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/session\_management.rb:123:in  
`process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/dispatcher.rb:171:in  
`handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/dispatcher.rb:126:in  
`dispatch_cgi' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/rails.rb:76:in  
`process' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/rails.rb:74:in `synchronize’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/rails.rb:74:in  
`process' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:159:in `process\_client’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:158:in  
`each' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:158:in `process\_client’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in `initialize’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in  
`new' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in `run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:268:in  
`initialize' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:268:in `new’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:268:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/configurator.rb:282:in `run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/configurator.rb:281:in  
`each' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/configurator.rb:281:in `run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/mongrel\_rails:128:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/command.rb:212:in `run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/mongrel\_rails:281  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:489:in  
`load' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load’  
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/mongrel.rb:64  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:496:in  
`require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new\_constants\_in’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:496:in  
`require' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem\_original\_require’  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' script/server:3 -e:2:in `load’  
-e:2

Request

Parameters:

None

Show session dump

* * *

as:pso\_account\_types:  
:list:  
page: 1  
as:customers:  
:list:  
page: “1”  
sort:  
- name  
- DESC  
:csrf\_id: db8af6e3a636b0c9bc9fa11a23392fa4  
as:psos:  
:list:  
page: “1”  
sort:  
- description  
- DESC  
as:pso\_accounts:  
:list: {}

:user\_id: 1  
as:units:  
:list:  
sort:  
- number  
- ASC  
page: “1”  
as:titles:  
:list: {}

:return\_to: /pso\_account\_types/  
flash: !map:ActionController::Flash::FlashHash {}

Response

Headers:

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

---

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [May 9, 2008, 1:13am UTC](https://www.ruby-forum.com/t/simple-generated-component-suddenly-gives-errors/137110/2 "2008-05-09T01:13:04Z")

</div>

this message  
undefined local variable or method `new\_pso\_printers\_path’ for

tells you, that you didn’t setup the necessary routing for this  
controller

in routes.rb simply type

map.resources :pso\_printers

that should be all to it…

---

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [May 9, 2008, 1:34am UTC](https://www.ruby-forum.com/t/simple-generated-component-suddenly-gives-errors/137110/3 "2008-05-09T01:34:31Z")

</div>

Thorsten M. wrote:

> this message  
> undefined local variable or method `new\_pso\_printers\_path’ for
> 
> tells you, that you didn’t setup the necessary routing for this  
> controller
> 
> in routes.rb simply type
> 
> map.resources :pso\_printers
> 
> that should be all to it…

It is already there in the routes.rb file :

map.resources :pso\_printers

It is still giving this error … after restarting it even.

Would you like to see the source and a data dump to see what is wrong?

---

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [May 9, 2008, 1:41am UTC](https://www.ruby-forum.com/t/simple-generated-component-suddenly-gives-errors/137110/4 "2008-05-09T01:41:38Z")

</div>

> Would you like to see the source and a data dump to see what is wrong?

first check the routes.rb, if you don’t have a typing error, for example  
map.route instead of map.routes (happens to me all the time 🙂

if not, use th command  
rake routes  
on the command line, that will give you all the routes that are defined

---

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [May 9, 2008, 4:57am UTC](https://www.ruby-forum.com/t/simple-generated-component-suddenly-gives-errors/137110/5 "2008-05-09T04:57:36Z")

</div>

Thorsten M. wrote:

> > Would you like to see the source and a data dump to see what is wrong?
> 
> first check the routes.rb, if you don’t have a typing error, for example  
> map.route instead of map.routes (happens to me all the time 🙂
> 
> if not, use th command  
> rake routes  
> on the command line, that will give you all the routes that are defined

I am not at work but I can assure you that first thing tomorrow morning  
I will find that its not a spelling error . I am using Aptana studio’s  
editor rails edge and although it doesnt do good checking or code  
completion but … are there any other checks I could make?

---

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [May 9, 2008, 2:47pm UTC](https://www.ruby-forum.com/t/simple-generated-component-suddenly-gives-errors/137110/6 "2008-05-09T14:47:22Z")

</div>

Thorsten M. wrote:

> > Would you like to see the source and a data dump to see what is wrong?
> 
> first check the routes.rb, if you don’t have a typing error, for example  
> map.route instead of map.routes (happens to me all the time 🙂
> 
> if not, use th command  
> rake routes  
> on the command line, that will give you all the routes that are defined

C:\ruby\letter4sure\>rake routes  
(in C:/ruby/letter4sure)  
pso\_printers GET /pso\_printers  
{:controller=\>“pso\_printers”, :action=\>“index”}  
formatted\_pso\_printers GET /pso\_printers.:format  
{:controller=\>“pso\_printers”, :action=\>“index”}  
POST /pso\_printers  
{:controller=\>“pso\_printers”, :action=\>“create”}  
POST /pso\_printers.:format  
{:controller=\>“pso\_printers”, :action=\>“create”}  
new\_pso\_printer GET /pso\_printers/new  
{:controller=\>“pso\_printers”, :action=\>“new”}  
formatted\_new\_pso\_printer GET /pso\_printers/new.:format  
{:controller=\>“pso\_printers”, :action=\>“new”}  
edit\_pso\_printer GET /pso\_printers/:id/edit  
{:controller=\>“pso\_printers”, :action=\>“edit”}  
formatted\_edit\_pso\_printer GET  
/pso\_printers/:id/edit.:format  
{:controller=\>“pso\_printers”, :action=\>“edit”}  
pso\_printer GET /pso\_printers/:id  
{:controller=\>“pso\_printers”, :action=\>“show”}  
formatted\_pso\_printer GET /pso\_printers/:id.:format  
{:controller=\>“pso\_printers”, :action=\>“show”}  
PUT /pso\_printers/:id  
{:controller=\>“pso\_printers”, :action=\>“update”}  
PUT /pso\_printers/:id.:format  
{:controller=\>“pso\_printers”, :action=\>“update”}  
DELETE /pso\_printers/:id  
{:controller=\>“pso\_printers”, :action=\>“destroy”}  
DELETE /pso\_printers/:id.:format  
{:controller=\>“pso\_printers”, :action=\>“destroy”}

–

ok I noticed that when I clicked on the model button it gave an error  
saying it could not find the model for pso\_printers ; that is because I  
did ruby script/generate scaffold pso\_printers and the model was  
pso\_printers.rb but it was looking for pso\_printer.

So I did script/generate scaffold pso\_printer and generated the files  
from there and it seems to be working.
