Module: Locomotive::Extensions::Shared::Slug::ClassMethods

Defined in:
app/models/locomotive/extensions/shared/slug.rb

Instance Method Summary collapse

Instance Method Details

#slugify_from(field) ⇒ Object



9
10
11
12
13
# File 'app/models/locomotive/extensions/shared/slug.rb', line 9

def slugify_from(field)
  class_eval <<-EOV
    before_validation { |object| object.send(:normalize_slug, :#{field.to_s}) }
  EOV
end