Skip to content

Commit

Permalink
selected_page? fixed for default locale when path does not include lo…
Browse files Browse the repository at this point in the history
…cale
  • Loading branch information
borisruf committed May 22, 2011
1 parent 2cf5d76 commit ad140a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/lib/refinery/helpers/menu_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def selected_page?(page)
path = path.force_encoding('utf-8') if path.respond_to?(:force_encoding)

# Ensure we match the path without the locale, if present.
if defined?(::Refinery::I18n) and ::Refinery::I18n.enabled? and path =~ %r{^/#{::I18n.locale}}
path = path.split(%r{^/#{::I18n.locale}}).last
if defined?(::Refinery::I18n) and ::Refinery::I18n.enabled? and path =~ %r{^/#{::I18n.locale}/}
path = path.split(%r{^/#{::I18n.locale}/}).last
path = "/" if path.blank?
end

Expand Down

0 comments on commit ad140a1

Please sign in to comment.