Skip to content

Instantly share code, notes, and snippets.

// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
//
if(!window.jq && window.jQuery){
var jq = jQuery;
};
if(!window.App){
window.App = {};
@CootCraig
CootCraig / webapp.rb
Created November 17, 2010 23:34 — forked from igrigorik/webapp.rb
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end