Skip to content

Instantly share code, notes, and snippets.

@tritonrc
Created April 5, 2010 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tritonrc/356766 to your computer and use it in GitHub Desktop.
Save tritonrc/356766 to your computer and use it in GitHub Desktop.
class SinatraApp < Sinatra::Base
get '/' do
'Hello from Sinatra'
end
end
RailsApp::Application.routes.draw do |map|
match '/applications/sinatra/*path' :to => proc { |env|
#BTM - PATH_INFO contains the full path (e.g. '/applications/sinatra/...')
#which we don't want to pass along to the sinatra app since we want
#it ignorant of where we attach it in the Rails routing space
env['PATH_INFO'] = env['action_dispatch.request.path_parameters'][:path]
SinatraApp.call(env)
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment