Created
January 20, 2010 00:17
-
-
Save moretea/281462 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
ActionController::Routing::Routes.draw do |map| | |
map_i18n map do |m| | |
map.connect blah | |
map.resource meh | |
end | |
end | |
# helper | |
def map_i18n map, &block | |
if site_has_multiple_languages | |
map.with_options :path_prefix => '/:locale' do |localized_map| | |
localized_map.instance_exec(block) | |
end | |
else | |
map.instance_exec(block) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment