Created
November 11, 2008 23:37
-
-
Save lukesutton/24027 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
The idea is to be able to examine a path inside a #defer_to block and | |
optionally rewrite parts of the request — path, subdomain etc. After the | |
rewrite, the request will go through the router again, where any matching | |
routes will then pick it up. |
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
match("/:locale/:dialect/:full_path", :full_path => /\S+/).defer_to do |request, params| | |
if is_clever? params[:full_path] | |
rewrite(params, :subdomain => "admin", :path => "/bongst") | |
else | |
params | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment