Created
June 5, 2012 15:42
-
-
Save jcalvert/2875821 to your computer and use it in GitHub Desktop.
Nested with_options
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
GET /:locale/services/foo/:name {:action=>"config", :controller=>"services/foo"} | |
GET /:locale/services/bar/:name {:action=>"config", :controller=>"services/bar"} |
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
ActionController::Routing::Routes.draw do |map| | |
map.with_options(:path_prefix => ':locale/services') do |services| | |
services.with_options(:controller => "services/foo") do |service| | |
service.connect '/foo/:name', :action => :config, :conditions => { :method => :get } | |
end | |
services.with_options(:controller => "services/bar") do |service| | |
service.connect '/bar/:name', :action => :config, :conditions => { :method => :get } | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment