# Routing problem for Rails 2 newbie

**URL:** <https://www.ruby-forum.com/t/routing-problem-for-rails-2-newbie/184096>\
**Category:** Rails\
**Created:** [February 24, 2010, 10:00pm UTC](https://www.ruby-forum.com/t/routing-problem-for-rails-2-newbie/184096 "2010-02-24T22:00:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [February 24, 2010, 10:00pm UTC](https://www.ruby-forum.com/t/routing-problem-for-rails-2-newbie/184096/1 "2010-02-24T22:00:31Z")

</div>

I’m running:  
WinXP-Pro/SP3  
Rails 2.3.5  
MySQL 5.0.37-community-nt  
Firefox 3.6 browser  
Mongrel web server

I have a Rails 2 app that initially brought up the Welcome screen

I ran:  
ruby script/generate scaffold vendor nickname:string  
qbname:string

I discovered that config\routes.ruby.rb now starts out:  
ActionController::Routing::Routes.draw do |map|  
map.resources :vendors

Following the advice of routes.rb, I renamed public\index.html by  
appending “-renamed”

When I give the browser [http://localhost:3000/](http://localhost:3000/), I get:  
Routing Error  
No route matches “/” with {:method=\>:get}

So the map.resources :vendors is not enough to get to:  
app\controllers\application\_controller.rb and  
app\views\vendors\something-or-other

Suggestions greatly appreciated.

Thanks in Advance,  
Richard

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [February 24, 2010, 10:21pm UTC](https://www.ruby-forum.com/t/routing-problem-for-rails-2-newbie/184096/2 "2010-02-24T22:21:02Z")

</div>

Hi,

With that configuration in routes.rb you have to go to  
[http://localhost:3000/vendors](http://localhost:3000/vendors) to get to your index action of the  
controller.

If you want to go directly you need to add map.root :controller =\>  
‘vendors’, :action =\> ‘index’ to your routes.rb

I hope that helps.

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [February 25, 2010, 4:59am UTC](https://www.ruby-forum.com/t/routing-problem-for-rails-2-newbie/184096/3 "2010-02-25T04:59:31Z")

</div>

That was perfect. I studying an on-line tutorial on REST, but its  
slow going. Thanks for help to get my Rails app to run.

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [March 18, 2010, 12:21am UTC](https://www.ruby-forum.com/t/routing-problem-for-rails-2-newbie/184096/4 "2010-03-18T00:21:50Z")

</div>

Restarting the server might do the trick in most cases

at the app level,

“ruby script/server”
