Skip to content

Instantly share code, notes, and snippets.

View ianstormtaylor's full-sized avatar
🖖

Ian Storm Taylor ianstormtaylor

🖖
View GitHub Profile
@ianstormtaylor
ianstormtaylor / gist:2519665
Created April 28, 2012 14:57
Enhanced Backbone.Router route function to handle trailing slashes and query strings.
// Enhanced route function that automatically binds variant routes.
route : function (route, name, callback) {
var variants = [
route,
route + '/',
route + '?:querystring',
route + '/?:querystring'
];