Skip to content

Instantly share code, notes, and snippets.

@moretea
Created January 20, 2010 00:17
Show Gist options
  • Save moretea/281462 to your computer and use it in GitHub Desktop.
Save moretea/281462 to your computer and use it in GitHub Desktop.
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