Forum: Ruby on Rails map.root question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fdb488647484e40f785dde7134afc6d1?d=identicon&s=25 Heinz Strunk (cojones)
on 2008-11-26 17:00
Heya,

I'm asking myself what the best method is to use map.root.

I have a table called page with various pages in it.

Default is:
map.root :controller => 'pages'
...would take me to the index. I don't want that.
map.root :controller => 'pages', :action => 'show', :id => 1
...would take me to the first page but if the id changes (remove and add
another page as start page) it wouldn't work anymore
map.root :controller => 'pages', :action => 'home'
...would do that what I'm writing in my own action 'home' but is it
really necessary to create an extra action for that?

How do you guys handle that? Any hints and opinions are highly
appreciated :)
This topic is locked and can not be replied to.