# \[Newbie question\] How does map.root?

**URL:** <https://www.ruby-forum.com/t/newbie-question-how-does-map-root/189020>\
**Category:** Rails\
**Created:** [May 22, 2010, 1:33am UTC](https://www.ruby-forum.com/t/newbie-question-how-does-map-root/189020 "2010-05-22T01:33:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![distriker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ecd19e/32.png) [@distriker](https://www.ruby-forum.com/u/distriker)\
**Post date:** [May 22, 2010, 1:33am UTC](https://www.ruby-forum.com/t/newbie-question-how-does-map-root/189020/1 "2010-05-22T01:33:32Z")

</div>

Hello, I am very ill and I don’t remember how does map.root.

I have this in the routes.rb:

ActionController::Routing::Routes.draw do |map| map.signup 'signup', :controller =\> 'users', :action =\> 'new' map.logout 'logout', :controller =\> 'sessions', :action =\> 'destroy' map.login 'login', :controller =\> 'sessions', :action =\> 'new' map.resources :sessions

map.resources :users

 

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

 

map.root :controller =\> ‘index’, :action =\> ‘index’

 

end  
\</ruby code\>

 

And the controller is app/controllers/index.rb and it have the class  
Index and the def Index. This is the code:

 class Index \< ActiveRecord::Base def Index

end  
end  
\</ruby code\>

 

If I put this in my rails project, say me this the localhost:

We're sorry, but something went wrong.

We’ve been notified about this issue and we’ll take a look at it  
shortly.

 

Can someone explain me how does the map.root?

 

Thanks for your attention.

 

Greetings

---

<div class="post-metadata">

**Author:** ![distriker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ecd19e/32.png) [@distriker](https://www.ruby-forum.com/u/distriker)\
**Post date:** [May 22, 2010, 4:45am UTC](https://www.ruby-forum.com/t/newbie-question-how-does-map-root/189020/2 "2010-05-22T04:45:31Z")

</div>

On May 22, 12:32 am, Distriker [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> We're sorry, but something went wrong.
> 
> We’ve been notified about this issue and we’ll take a look at it  
> shortly.
> 
> Can someone explain me how does the map.root?

I don’t think this has anything to do with map.root - your controller  
should be called IndexController, it should be in index\_controller.rb  
and it shouldn’t be inheriting from ActiveRecord::Base. Also, method  
names should begin with a lowercase character.

Fred
