Module: ContentfulRails::Sluggable

Extended by:
ActiveSupport::Concern
Defined in:
lib/contentful_rails/sluggable.rb

Overview

A quick mixin to slugify a field other than ‘slug’ NOTE that if you include sluggable (and define a slug field) in a class which responds to slug() than you’ll get a stack level too deep error.

Instance Method Summary collapse

Instance Method Details

#slugObject

Returns the slugified version of the :slug_field



13
14
15
# File 'lib/contentful_rails/sluggable.rb', line 13

def slug
  send(self.class.slug_field).parameterize(ContentfulRails.configuration.slug_delimiter) if self.class.slug_field.present?
end