Martin M
Martin M

Reputation: 8668

How can I use slug candidates with frienldy_id and simple_i18n

In a Rails4 app, I use friendly_id 5.0.1 with the plugin simple_i18n with two locales en and de.

In my model, I have name_de, name_en and title_de, title_en (and of cause slug_de, slug_en).
When saving the model, I used to set both slugs in a before_save hook:

def set_slug
  set_friendly_id name_de, :de
  set_frinedly_id name_en, :en
end

Now I'd like to use the new slug_candidates functionality.

How can I do that?

def set_slug
  set_friendly_id [:name_de,:title_de], :de
  set_frinedly_id [:name_en,:title_en], :en
end

doesn't work.

Upvotes: 1

Views: 231

Answers (1)

Norman Clarke
Norman Clarke

Reputation: 436

FriendlyId author here. Sorry, at the moment that is not implemented, which really is an oversight on my part. I will try to add that functionality soon.

Upvotes: 1

Related Questions