There are some Blog posts out there about Rails and nice URLs for SEO. I don’t know if it really works, but it’s easy to do and nice URLs can never be wrong, can they?
There’s also a plugin called acts_as_sluggable which does exactly that, so that you can do things like
class BlogPost
acts_as_sluggable :with => :title
end
And get URIS like
http://www.example.com/blogposts/3-my-cat-ate-my-flowers
There are some problems with act_as_slugable and Rails 1.2, though. Acts_as_sluggable comes with some ActiveRecord monkey patching for the find_from_ids method. As mentioned by Obie Fernandez this isn’t necessary for Rails 1.2 because Rails all the to_i-stuff itself. So if you want to use the plugin with Rails 1.2 just comment out the active_records_overrides.rb contents and you should be fine.
Related Posts
- Deploying a Rails application on OpenSolaris with passenger aka modrails - A howto on how to deploy a Rails application on the latest OpenSolaris 2008.11 operating system with modrails aka passenger
- Russian technology - nginx config via 'nginx config generator' plus bonus: feed redirects for feedburner
- Strange errors and simple solution - Strange Rails errors with Object::ViewTranslation
- HTTP-Referer and redirect_to :back - Using redirect_to :back in Rails without HTTP referer is not supported by default. It's possible with this snippet of code