# \[newbi\] Problem Routes

**URL:** <https://www.ruby-forum.com/t/newbi-problem-routes/93453>\
**Category:** Rails\
**Created:** [April 3, 2006, 5:34pm UTC](https://www.ruby-forum.com/t/newbi-problem-routes/93453 "2006-04-03T17:34:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bolo\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f14d63/32.png) [@Bolo\_M](https://www.ruby-forum.com/u/Bolo_M)\
**Post date:** [April 3, 2006, 5:34pm UTC](https://www.ruby-forum.com/t/newbi-problem-routes/93453/1 "2006-04-03T17:34:21Z")

</div>

Hello,

i try to follow this video  
[http://www.illanti.com/files/locomotive101.mov](http://www.illanti.com/files/locomotive101.mov)

After change my routes  
routes.db  
ActionController::Routing::Routes.draw do |map|

# Add your own custom routes here.

# The priority is based upon order of creation: first created →

highest priority.

# Here’s a sample route:

# map.connect ‘products/:id’, :controller =\> ‘catalog’, :action =\>

‘view’

# Keep in mind you can assign values other than :controller and :action

# You can have the root of your site routed by hooking up ‘’

# – just remember to delete public/index.html.

map.connect ‘’, :controller =\> ‘notes’

# Allow downloading Web Service WSDL as a file with an extension

# instead of a file named ‘wsdl’

map.connect ‘:controller/service.wsdl’, :action =\> ‘wsdl’

# Install the default route as the lowest priority.

map.connect ‘:controller/:action/:id’  
end

and deleted index.html. I launch my browser

[http://localhost:3000/](http://localhost:3000/)

i have this error message  
NameError in #

uninitialized constant NoteController  
RAILS\_ROOT:  
/Users/bolomichelin/Documents/Creation\_Perso/Developement/monApp/public/…/config/…

Application Trace | Framework Trace | Full Trace  
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/dependencies.rb:200:in  
`const_missing' /Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:72:in `const\_missing’  
generated/routing/recognition.rb:4:in `recognize\_path’  
This error occured while loading the following files:  
note\_controller.rb

Where is the problem ?

Bolo

---

<div class="post-metadata">

**Author:** ![Bolo\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f14d63/32.png) [@Bolo\_M](https://www.ruby-forum.com/u/Bolo_M)\
**Post date:** [April 3, 2006, 7:42pm UTC](https://www.ruby-forum.com/t/newbi-problem-routes/93453/2 "2006-04-03T19:42:08Z")

</div>

Does your note\_controller.rb have an “index” method? If it calls the  
list action (as scaffoling generates), is your views/note/list.rhtml in  
place? If not and you defined an index action of your own, do you have a  
matching view?

If none of this sheds any light, try changing your route so that it  
calls not just the controller but also a specific action that you know  
works.

Bolo M. wrote:

> Hello,
> 
> i try to follow this video  
> [http://www.illanti.com/files/locomotive101.mov](http://www.illanti.com/files/locomotive101.mov)
> 
> After change my routes  
> routes.db  
> ActionController::Routing::Routes.draw do |map|
> 
> # Add your own custom routes here.
> 
> # The priority is based upon order of creation: first created →
> 
> highest priority.
> 
> # Here’s a sample route:
> 
> # map.connect ‘products/:id’, :controller =\> ‘catalog’, :action =\>
> 
> ‘view’
> 
> # Keep in mind you can assign values other than :controller and :action
> 
> # You can have the root of your site routed by hooking up ‘’
> 
> # – just remember to delete public/index.html.
> 
> map.connect ‘’, :controller =\> ‘notes’
> 
> # Allow downloading Web Service WSDL as a file with an extension
> 
> # instead of a file named ‘wsdl’
> 
> map.connect ‘:controller/service.wsdl’, :action =\> ‘wsdl’
> 
> # Install the default route as the lowest priority.
> 
> map.connect ‘:controller/:action/:id’  
> end
> 
> and deleted index.html. I launch my browser
> 
> [http://localhost:3000/](http://localhost:3000/)
> 
> i have this error message  
> NameError in #
> 
> uninitialized constant NoteController  
> RAILS\_ROOT:  
> /Users/bolomichelin/Documents/Creation\_Perso/Developement/monApp/public/…/config/…
> 
> Application Trace | Framework Trace | Full Trace  
> /Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/dependencies.rb:200:in  
> `const_missing' /Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:72:in `const\_missing’  
> generated/routing/recognition.rb:4:in `recognize\_path’  
> This error occured while loading the following files:  
> note\_controller.rb
> 
> Where is the problem ?
> 
> Bolo

---

<div class="post-metadata">

**Author:** ![Bolo\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f14d63/32.png) [@Bolo\_M](https://www.ruby-forum.com/u/Bolo_M)\
**Post date:** [April 4, 2006, 1:12am UTC](https://www.ruby-forum.com/t/newbi-problem-routes/93453/3 "2006-04-04T01:12:29Z")

</div>

Hello,

> What is the name of your controller ?  
> i try this  
> map.connect ‘’, :controller =\> ‘note’  
> and that  
> map.connect ‘’, :controller =\> ‘notes’

> Did [http://localhost:3000/notes](http://localhost:3000/notes) was ok ?  
> No it’s not ok  
> NameError in Notes#index

uninitialized constant Note  
RAILS\_ROOT:  
/Users/bolomichelin/Documents/Creation\_Perso/Developement/monApp/public/…/config/…

Application Trace | Framework Trace | Full Trace  
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/dependencies.rb:200:in  
`const_missing' /Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/core_ext/string/../../inflector.rb:149:in `constantize’  
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/core\_ext/string/inflections.rb:52:in  
`constantize' /Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/pagination.rb:186:in `paginator\_and\_collection\_for’  
/Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_controller/pagination.rb:124:in  
`paginate' #{RAILS_ROOT}/app/controllers/notes_controller.rb:8:in `list’  
#{RAILS\_ROOT}/app/controllers/notes\_controller.rb:3:in `index’  
This error occured while loading the following files:  
note.rb

> the name in the the route.rb must be the same as the controller you  
> want to map. In this case , you must have a notes\_controller.rb`

yes i have this file.

Bolo

---

<div class="post-metadata">

**Author:** ![Bolo\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f14d63/32.png) [@Bolo\_M](https://www.ruby-forum.com/u/Bolo_M)\
**Post date:** [April 3, 2006, 7:42pm UTC](https://www.ruby-forum.com/t/newbi-problem-routes/93453/4 "2006-04-03T19:42:56Z")

</div>

Bolo M. wrote:

> and deleted index.html. I launch my browser
> 
> [http://localhost:3000/](http://localhost:3000/)
> 
> i have this error message  
> NameError in #
> 
> uninitialized constant NoteController  
> RAILS\_ROOT:  
> /Users/bolomichelin/Documents/Creation\_Perso/Developement/monApp/public/…/config/…
> 
> Application Trace | Framework Trace | Full Trace  
> /Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/dependencies.rb:200:in  
> `const_missing' /Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:72:in `const\_missing’  
> generated/routing/recognition.rb:4:in `recognize\_path’  
> This error occured while loading the following files:  
> note\_controller.rb
> 
> Where is the problem ?
> 
> Bolo

What is the name of your controller ?  
Did [http://localhost:3000/notes](http://localhost:3000/notes) was ok ?  
the name in the the route.rb must be the same as the controller you  
want to map. In this case , you must have a notes\_controller.rb
