Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save brenes/3979166 to your computer and use it in GitHub Desktop.

Select an option

Save brenes/3979166 to your computer and use it in GitHub Desktop.
Decoration of Refinery::Page for getting rid of locale=XX bug on refinerycms_translate_routes
Refinery::Page.class_eval do
# When this page is rendered in the navigation, where should it link?
# If a custom "link_url" is set, it uses that otherwise it defaults to the nested path.
# This method is decorated so the ?locale=es doesn't appear at the end of the urls
def url
if link_url.present?
link_url_localised?
else
nested_path
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment