Skip to content

Instantly share code, notes, and snippets.

@franckt
Created June 4, 2015 15:18
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 franckt/7c6a8cf5f0d7deffb9be to your computer and use it in GitHub Desktop.
Save franckt/7c6a8cf5f0d7deffb9be to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
include SessionPersistence
protect_from_forgery
before_filter :setup_venue
before_action :fetch_body
def setup_venue
@venue = request.headers["X-Venue"]
ActiveRecord::Base.establish_connection(
adapter: "postgresql",
database: @venue,
encoding: "utf8"
)
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment