Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module NiceParam
- module InstanceMethods
- def to_param
- "#{id}-#{title.downcase.
- gsub("å","aa").
- gsub("æ","ae").
- gsub("ø","oe").
- gsub(/[^[:alnum:]]/,'-')}".
- gsub(/-{2,}/,'-')
- end
- end
- def self.included(receiver)
- receiver.send :include, InstanceMethods
- end
- end
Add Comment
Please, Sign In to add comment