Created
August 12, 2008 14:09
-
-
Save ryanb/5046 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# single controller | |
map.with_options :controller => 'info' do |info| | |
info.about 'info/about', :action => 'about' | |
info.privacy 'legal/privacy', :action => 'privacy' | |
info.license 'legal/license', :action => 'license' | |
end | |
# multiple controllers | |
map.about 'info/about', :controller => 'info', :action => 'about' | |
map.privacy 'legal/privacy', :controller => 'legal', :action => 'privacy' | |
map.license 'legal/license', :controller => 'legal', :action => 'license' | |
# pages controller with nesting (parse params[:pages] array in show action) | |
# the page model could use acts_as_tree for nesting. | |
map.resources :pages | |
map.nested_page '*pages', :controller => 'pages', :action => 'show' | |
# I think the "one controller" approach is the safest if you aren't sure. | |
# You can refactor into the others as needed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment