Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mugwump opened this issue Nov 18, 2013 · 0 comments
Open

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

mugwump opened this issue Nov 18, 2013 · 0 comments

Comments

@mugwump
Copy link

mugwump commented Nov 18, 2013

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant