RFC: MyModel#to_params for use in url helpers & url_for

Seems like this belongs in a helper.


Alternatively, you could simply pre-generate the slugged-URL and store it with the product itself, or in a K/V store, or etc. Generating a slugged path every single time doesn't seem like the best use of resources. Regardless, I'm not sure this logic necessarily belongs in the Model. I'd probably create a SluggedPathsHelper module and store this logic there, and keep the Model clean.

#to_params is also a terrible name for a method like this. If you did put it in the Model, you'd probably want to call it #slugged_product_path_params. It's long, but you'll know wtf it does 3-months from now.