I have a model (Category) with a :name
attribute, and I defined a route for it like this:
get ':name' => 'categories#show'
The problem is, some Categories have names containing the character "/". So if, for example, a Category is named "Drugs/Pharmacy", then the url is interpreted as categories#Drugs#Pharmacy
, not categories#Drugs/Pharmacy
.
Has anyone else ran into this problem? How could I get around this? I suppose I could slice that character from every url, but it would be cool if I could include it somehow.