Easily Convert Namespaced Class Names to Paths in Rails
I came across this nifty little tip in a GoRails episode and wanted to pass it along.
Typically, I'm using
#underscore on class names to convert
Little did I know, it works on namespaced classes too.
It will convert '::' to '/'. So calling
will result in
This obviously comes in handy if you're needing to map class names to paths in Rails.