# How to route to index?

**URL:** <https://www.ruby-forum.com/t/how-to-route-to-index/75325>\
**Category:** Rails\
**Created:** [November 9, 2006, 4:13am UTC](https://www.ruby-forum.com/t/how-to-route-to-index/75325 "2006-11-09T04:13:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 9, 2006, 4:13am UTC](https://www.ruby-forum.com/t/how-to-route-to-index/75325/1 "2006-11-09T04:13:27Z")

</div>

hey there,  
i am a brand new rails guy. I am using rad rails because i already use  
eclipse for all things python and php.  
my question is, when you start a new project, how do you get the index  
page in the web folder to point to different controllers ? What i mean  
is, in all the tutorials, you see them point browsers to  
localhost:3000/say/hello, or localhost:3000/user/login. But if i point  
an app to localhost:3000/ should i just redirect\_to to wherever i want  
the index page to be?

i know this is the most basic of questions. I am still trying to get my  
head around MVC. I know it will be worth it in the end, but now…

thanks

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 9, 2006, 4:19am UTC](https://www.ruby-forum.com/t/how-to-route-to-index/75325/2 "2006-11-09T04:19:27Z")

</div>

check out config/routes.rb

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

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

# map.connect ‘’, :controller =\> “welcome”

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 9, 2006, 4:19am UTC](https://www.ruby-forum.com/t/how-to-route-to-index/75325/3 "2006-11-09T04:19:28Z")

</div>

edit config/routes.rb and add:

map.connect ‘’, :controller =\> “whatever”

before the line map.connect ‘:controller/:action/:id’

where “whatever” is simply the controller that you wish to handle the  
request for localhost:3000/

If you want to specify a default method (instead of “index”) then  
just add this to the end of the line:  
map.connect ‘’, :controller =\> “whatever”, :action =\> “however”.

```
~Wayne
```

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 9, 2006, 4:21am UTC](https://www.ruby-forum.com/t/how-to-route-to-index/75325/4 "2006-11-09T04:21:28Z")

</div>

On Nov 8, 9:17 pm, “Wayne E. Seguin” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> just add this to the end of the line:
> 
> > eclipse for all things python and php.  
> > get my  
> > head around MVC. I know it will be worth it in the end, but now…
> 
> > thanks

well ok, thanks guys !  
-shawn
