I’ve just released my first proper Ruby gem. It’s a simple permalink style slug generator for ActiveModel. Check it out at Github and use it in your Rails project by adding
gem "slugtastic" to your Gemfile.
Usage is very simple. Just add the following to your model:
has_slug :slug, :from => :title
This will generate a slug string from the title attribute and store it in the slug attribute unless the slug already contains a string. The slug is generated pre-validation so you can still use