ryanb (owner)

Revisions

gist: 5046 Download_button fork
public
Public Clone URL: git://gist.github.com/5046.git
Embed All Files: show embed
routes.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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.