Skip to content

Instantly share code, notes, and snippets.

View ohrite's full-sized avatar
💭
🎶 solving everything with pairing

Doc Ritezel ohrite

💭
🎶 solving everything with pairing
View GitHub Profile
@ohrite
ohrite / router.js
Created March 19, 2011 20:33
Route resolver for Rails3 into Backbone-style routes
// Router.js 0.1.0
// (c) 2011 Doc Ritezel
// Freely distributable under the MIT license.
//
// Load this before rails_routes.js (generated by routes_to_javascript.rb)
// Enables:
// var c = new Backbone.Controller({ routes: { Routes.root(): 'index' } });
// $('a.delete').attr('href', Routes.delete_item(3));
(function(){