module Concerns::Category::FriendlyParam::InstanceMethods

Public Instance Methods

set_friendly_param() click to toggle source
# File app/models/concerns/category/friendly_param.rb, line 25
def set_friendly_param
  self.friendly_param = to_friendly_param
end
to_friendly_param() click to toggle source

Lowercase underscore

# File app/models/concerns/category/friendly_param.rb, line 30
def to_friendly_param
  name.underscore.gsub('+', '_plus').gsub(%r[^\w]+/, '_').gsub(%r^_/, '').gsub(%r_$/, '').gsub(%r_+/, '_')
end