I have a model which I use its friendly id as slug:
extend FriendlyId
friendly_id :slug_candidates, :use => :scoped, :scope => :account
def slug_candidates
:title_and_sequence
end
def title_and_sequence
slug = normalize_friendly_id(title)
:
# some login to add sequence in case of collision
:
end
My problem is that when I use non-Latin chars (Arab, Hebrew,...) I get an empty slug. Is there any nice-and-easy solution?
UPDATE
Just to make my question clear, I would like to have the same behaviour as WordPress, which means:
+--------------------+----------------------------------------------------+
| Title | url |
+--------------------+----------------------------------------------------+
| Hello World!! | /hello-world |
+--------------------+----------------------------------------------------+
| Helló Világ | /hello-vilag |
+--------------------+----------------------------------------------------+
| שלום עולם | /%D7%A9%D7%9C%D7%95%D7%9D-%D7%A2%D7%95%D7%9C%D7%9D |
+--------------------+----------------------------------------------------+
| مرحبا | %D9%85%D8%B1%D8%AD%D8%A8%D8%A7 |
+--------------------+----------------------------------------------------+
(both Arabic and Hebrew are translated in modern browsers to original and readable characters).