Skip to content

Instantly share code, notes, and snippets.

@aypn0s
Created December 17, 2014 12:59
Show Gist options
  • Select an option

  • Save aypn0s/0dc54e5d3d71e2dbd894 to your computer and use it in GitHub Desktop.

Select an option

Save aypn0s/0dc54e5d3d71e2dbd894 to your computer and use it in GitHub Desktop.
Friendly_id with babosa
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