Skip to content

updating slugs using self.set_friendly_id t.title, t.locale #2

@mugwump

Description

@mugwump

I'm using slugged together with friendly_id-globalize on my model:

extend FriendlyId
friendly_id :title, :use => [:globalize, :slugged]

The initial generation of the slug works fine, but when I try to update my slugs when the title has changed with:

    self.translations.each do |t|
      t.slug = self.set_friendly_id t.title, t.locale
    end

I get a:

NoMethodError: undefined method `set_friendly_id'

Is there a better, or at least a working way to handle slug-updates?! I've migrated from an earlier version of friendly_id where this approach worked, but as the docs haven't changed on I assumed that this should still be working...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions