Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Commit

Permalink
Fixed root_path (prefix_on_default_locale tests are broken though)
Browse files Browse the repository at this point in the history
  • Loading branch information
raul committed Nov 14, 2010
1 parent ceca754 commit e7cfdfc
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/route_translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,10 @@ def translate route_set
end
end

if root_route = original_named_routes[:root]
add_root_route root_route, route_set
end

original_named_routes.each_key do |route_name|
route_set.named_routes.helpers.concat add_untranslated_helpers_to_controllers_and_views(route_name)
end

end

# Add unmodified root route to route_set
Expand All @@ -187,7 +184,7 @@ def add_root_route root_route, route_set
def add_untranslated_helpers_to_controllers_and_views old_name
['path', 'url'].map do |suffix|
new_helper_name = "#{old_name}_#{suffix}"

ROUTE_HELPER_CONTAINER.each do |helper_container|
helper_container.send :define_method, new_helper_name do |*args|
send "#{old_name}_#{locale_suffix(I18n.locale)}_#{suffix}", *args
Expand Down Expand Up @@ -239,9 +236,6 @@ def translate_path path, locale
end

new_path = "/#{locale}#{new_path}" if add_prefix? locale
# if add_prefix? locale
# new_path = "/:#{LOCALE_PARAM_KEY}" + new_path
# end

new_path.blank? ? '/' : new_path
end
Expand Down

0 comments on commit e7cfdfc

Please sign in to comment.