I am using acts_as_taggable according to the examples in the Rails Recipes book. Everything works fine except for cases where I want to use a tag with a dot (like .NET) or a slash (like COM/OLE).
The problem is not really with acts_as_taggable, but rather with routing.
I am using the suggested technique where I use urls like /kb/list/ mytag to display all the entries tagged "mytag."
Here is the console output showing what happens when I use urls with dots or slashes:
This works as expected:
rs.recognize_path "/kb/list/mytag"
=> {:id=>"mytag", :action=>"list", :controller=>"kb"}
But check these out:
rs.recognize_path "/kb/list/.NET"
=> {:anything=>["kb", "list", ".NET"], :controller=>"kb", :action=>"index"}
rs.recognize_path "/kb/list/COM%2FOLE"
=> {:anything=>["kb", "list", "COM", "OLE"], :controller=>"kb", :action=>"index" }
Note that I replaced "/" with "%2F" because that's what happens in the browser when it urlencodes the string "COM/OLE."
I suppose I could re-write the "list" action to use numeric ids instead of tag names, but I would hate to lose that functionality.
Does anybody know how to get routing to work under these circumstances?