Subscribe to my Feed, follow me on Twitter, recommend me on Working With Rails or see my code on GitHub
Comparison with server-side routes
This plugin only replicates the generation functionality of the routes in Rails. I’m not sure how useful being able to recognise routes (parse URLs) in the browser would be anyway..
The implementation is not a 1:1 copy, but more of an empirical replication that (hopefully) produces the same results as the original, so there may be some things that aren’t taken into account or doesn’t make sense. Some of these things have to do with the browser environment and the lack of access to the request.
No defaults from the current request
One of those is the way Rails automatically uses pieces of the current request as default when generating URLs. Because there’s no recognition taking place, this isn’t possible.
No HTTP methods
Rails allows you to define conditions for a route, where currently (I think) only the HTTP method used in the request is actually taken into consideration. This doesn’t make sense in the browser, so only those routes without this condition or those that respond to GET requests are included.
