Skip to content

Instantly share code, notes, and snippets.

@kisai
Created August 27, 2014 17:27
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 kisai/5af3d717fcbf68ee8035 to your computer and use it in GitHub Desktop.
Save kisai/5af3d717fcbf68ee8035 to your computer and use it in GitHub Desktop.
# http://robots.thoughtbot.com/how-to-share-a-session-between-sinatra-and-rails
# wanna do this
get '/dashboard' do
if session[:user_id].present?
redirect to('/')
else
# set up and render dashboard
end
end
# then
# Rack::Builder
# config.ru
map '/api' do
run MySinatraApp.new
end
map '/' do
run MyRailsApp::Application.new
end
#or we can load sinatra apps with in rails
MyRailsApp::Application.routes.draw do
mount MySinatraApp.new => '/api'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment