On Oct 3, 2008, at 4:54 PM, Ben Knight wrote:

> Hi, guys.  I ended up doing this for now and it works for us (for  
> now):
>
>   title.downcase.gsub(/[(,?!\'":.)]/, '').gsub(' ', '-').gsub(/-$/,  
> '')

What about multiple dashes in the middle of the title?

For example, given:

Primetime Emmy Award for Outstanding Lead Actress - Miniseries or a  
Movie

One would expect:

primetime-emmy-award-for-outstanding-lead-actress-miniseries-or-a-movie

Note the transition between 'Actress' and 'Miniseries'.

Cheers,

--
PA.
http://alt.textdrive.com/nanoki/


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

Reply via email to