I have the following in my model:
class Dispenser < ActiveRecord::Base
extend FriendlyId
friendly_id :slug_candidates, use: :slugged
def slug_candidates
[
:full_name,
[:full_name, :id]
]
end
end
This is generating slugs like:
=> 'bob-barker-bob-barker-15'
Really it should be bob-barker
or bob-barker-15
, but not both.
[:full_name, :id], <<<
– Damien Roche