module FriendlyId::Slugged::Model

Attributes

slug[RW]

Public Instance Methods

find_slug() click to toggle source
# File lib/friendly_id/slugged.rb, line 43
def find_slug
  raise NotImplementedError
end
friendly_id() click to toggle source

The friendly id.

# File lib/friendly_id/slugged.rb, line 57
def friendly_id
  slug.to_friendly_id
end
friendly_id_config() click to toggle source
# File lib/friendly_id/slugged.rb, line 47
def friendly_id_config
  self.class.friendly_id_config
end
friendly_id_status() click to toggle source

Get the {FriendlyId::Status} after the find has been performed.

# File lib/friendly_id/slugged.rb, line 52
def friendly_id_status
  @friendly_id_status ||= Status.new(:record => self)
end
normalize_friendly_id(string) click to toggle source

Clean up the string before setting it as the friendly_id. You can override this method to add your own custom normalization routines. @param string An instance of {FriendlyId::SlugString}. @return [String]

# File lib/friendly_id/slugged.rb, line 65
def normalize_friendly_id(string)
  string.normalize_for!(friendly_id_config).to_s
end
slug?() click to toggle source

Does the instance have a slug?

# File lib/friendly_id/slugged.rb, line 70
def slug?
  !! slug
end