Rimian
Rimian

Reputation: 38418

undefined method `slug_limit=' for friendly_id

When I set the slug_limit on friendly_id as per the documentation in the initializer, I see the following error:

Failure/Error: extend FriendlyId

NoMethodError:
  undefined method `slug_limit=' for #<#<Class:0x00007ffe66dd01a0>:0x00007ffe66dd0150>
# ./config/initializers/friendly_id.rb:68:in `block in <top (required)>'

My model implements friendly_id like this:

extend FriendlyId
friendly_id :title, use: [:slugged, :finders]

How do I set the slug limit?

Upvotes: 0

Views: 176

Answers (1)

eux
eux

Reputation: 3282

You could try to set slug_limit like this from the test example:

extend FriendlyId
friendly_id :title, use: :slugged, slug_limit: 40

Upvotes: 1

Related Questions