RailheadPermalink is a Ruby on Rails plugin that automatically finds ActiveRecord objects with permalink.
Add to your Gemfile:
gem 'railhead_permalink'
Add permalink field to your schema:
t.string :permalink
Setup permalink for your ActiceRecord object:
auto_permalink :title
You can setup reserved names too:
auto_permalink :title, reserved_names: %w(reserved names)
You can keep already existing permalinks:
auto_permalink :title, keep_existing: true
Copyright © 2008-2015 Bence Nagy (bence.nagy@gmail.com), released under the MIT license.