Created
December 17, 2014 12:59
-
-
Save aypn0s/0dc54e5d3d71e2dbd894 to your computer and use it in GitHub Desktop.
Friendly_id with babosa
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
| extend FriendlyId | |
| friendly_id :title, use: :slugged | |
| def normalize_friendly_id(input) | |
| input.to_s.to_slug.normalize(transliterations: :greek).to_s | |
| end | |
| def should_generate_new_friendly_id? | |
| title_changed? | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment