Squish the slug the Rails way

Recently Pat wrote about writing a quick method for making URL slugs. In the spirit of sharing I thought I’d mention a strategy I use in a number of the Rails apps I work on:

Take this code put it in a file named inflectors.rb in your config/initializers directory, and you’re good to go.

Posted
Views