If you are building a social Rails application, or any other Rails application that needs to have a URL slug, rather than the typical users/admin/232 type of URL scheme, then the acts_as_slugable plugin is going to be a perfect fit.
In my current Rails project, I want the users to be have their own “storefront” per se. Using acts_as_slugable, I can now have my URL scheme go from
http://www.example.com/users/145
to something like this
http://www.example.com/users/cory-perry
Much better for SEO, linking, and just overall a better URL in general.
Acts_as_slugable generates the URL slug based on a specific field that you specify, making it fairly easy to create URL slugs customized to your specific app needs. This is an extremely helpful plugin!
To install this plugin into your Rails app, execute this code from your command line:
./script/plugin install http://code.dunae.ca/acts_as_slugable
- BROWSE / IN TIMELINE
- « Bort - A base Rails application
- » REVIEW: XBox 360 Wireless Steering Wheel
- BROWSE / IN Development Rails Gems/Plugins Ruby on Rails
- « Bort - A base Rails application
- » Rails community finally gets much needed documentation upgrade
- RELATED / YOU MIGHT FIND THESE INTERESTING No related posts
COMMENTS / 2 COMMENTS
rick added these pithy words on Sep 20 08 at 5:31 pmYou may be interested in permalink_fu, it’s been used in a lot of projects and supports a few more options than yours: http://github.com/technoweenie/permalink_fu/tree/master/lib/permalink_fu.rb
SPEAK / ADD YOUR COMMENT
Comments are moderated.






