Skip to content

Instantly share code, notes, and snippets.

@jnewland
Created January 22, 2009 17:30
Show Gist options
  • Save jnewland/50625 to your computer and use it in GitHub Desktop.
Save jnewland/50625 to your computer and use it in GitHub Desktop.
# A Sinatra App as a Rails Plugin
#
# In your Edge Rails app:
#
# ruby script/plugin install git://gist.github.com/50625.git
require 'sinatra/base'
class SinatraRailsPlugin < Sinatra::Base
get '/foo' do
'bar'
end
#this hackeration is required for sinatra to be a nice rack citizen
error 404 do
@app.call(env)
end
end
config.after_initialize do
config.gem 'sinatra'
config.middleware.use SinatraRailsPlugin
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment