module Pancakes
  class DatabasesController < ApplicationController
    def show
      # connect to pg/database/:database
    end

    def index
      redirect_to database_path(Rails.env)
    end
  end
end

module Pancakes
  class DatabasesController < ApplicationController
    def show
      connection = Pancakes.connect(database: params[:id])
      connection.exec("SELECT table_name FROM information_schema.tables WHERE table_schema='public'")
    end

    def index
      redirect_to database_path(Rails.env)
    end
  end
end

Connect to database in show action.
Connect to database in show action.
