ruby: user friendly url, slug
i had a requirement to create user friendly url, like the following example -
www.domain.com/user-friendly-url,
so you know i am getting more and more passion over ruby stuff, http://blood.we4tech.com just brought me on rails again.
here is the ruby code snap, which removes all kinda illegal characters and creates a nice slug -
title.gsub(/[^[:alnum:]]+/i, “_”)
thanks push.cx for quick nice example
best wishes,




