Created
April 5, 2010 19:38
-
-
Save tritonrc/356766 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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