Solutions for Slugs of All Sizes: acts_as_url + to_param
Rails loves convention over configuration. But sometimes we need to tweak those configurations, like using a slug in our parameters instead of an object’s primary key! Luckily, we don’t need to reinvent the wheel, because this problem has been solved in a variety of ways. This blog post looks at one of those solutions, the acts_as_url
library, and how it overrides Rails’ to_param
method.
Post a comment