Hello. We have book titles as a column in our database, which I would like to use in our URLS for SEO purposes. Given that these are titles, they include characters other than alphabets and numbers (e.g. punctuation, blanks, foreign characters in some cases).
What's the easiest way to do this? Here is some more information: Original string: On One Flower: Butterflies, Ticks and a Few More Icks What I would like to see: on-one-flower-butterflies-ticks-and-a-few-more-icks I'm currently doing something like this; is there a better way? title.squeeze.downcase.tr("(),? !':.[]", "-").gsub('--', '-') Thanks in advance. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---