Created
October 30, 2012 09:12
-
-
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
This file contains hidden or 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
| 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