dynamic database active record
class ApplicationController < ActionController::Base
before_action :db_config
def db_config
ActiveRecord::Base.establish_connection(
{
:adapter => "postgresql",
:database => "dynamic_db",
:host => "localhost",
:username => "habib",
:password => "password"
}
)
end
end