I see lots of :
map.root :controller => "home"
Its I know simple, but what does home point to? A file? A controller? How/where does it gets its magic?
I see lots of :
map.root :controller => "home"
Its I know simple, but what does home point to? A file? A controller? How/where does it gets its magic?
In that case, Rails would route root requests to the 'home' controller, although you should probably specify an action just to be unambiguous... I imagine you do want the index action
Read the documentation.
This particular route maps "/" to the action index
(default) of the controller "home", most likely in "app/controllers/home_controller.rb".
map.connect "foo", :controller => "something"
, similarly, maps /foo to the index
action of the "something" controller.
Hi rtfminc
map.root :controller => "home" has two things hapenning
1 - map.root will always consider as your web sites home page
as an example if you have your home page in a controller called 'website' and in an action called 'home_page'
you can give the root as
map.root :controller => "website", :action => 'home_page'
2 - If you are directing to a controller with out giving an action, rails will default redirect to that controllers 'index' action
So in this case
map.root :controller => "home" will redirect to 'home' controllers 'index' action
hope this helps
cheers, sameera