Sneaky Abstractions

Subscribe to my Feed, follow me on , recommend me on Working With Rails or see my code on GitHub

Comment

You're viewing a comment to the page ActsAsSluggable

By Tore Darell at

Tauruz: All acts_as_sluggable did was define a default to_param with some simple replacement and patch ActiveRecord::Base#find to be able to find a record by ID with a string like “10-foo-bar”. AR doesn’t need this patch anymore, and defining a to_param method on a model is not much more work than adding acts_as_sluggable to it. As a bonus, you know exactly how your to_param works and can modify it without having to look deep inside a plugin directory to find it.

Tear down the house and build a boat!
Abandon wealth and seek living beings!
Spurn possessions and keep alive living beings!