-2

I am having different databases for each signup and there is one common Global database for sign in authentication..

What i need is After Logged in, user should be switched to other database and that switched database should be used throughout application until user logged out.

Right now when i switch database after logged in, it does connection with default database(database.yml) on every controller request.

  • 1
    possible duplicate of [Connecting to multiple databases in ruby on rails](http://stackoverflow.com/questions/17311199/connecting-to-multiple-databases-in-ruby-on-rails) – Norbert Sep 18 '15 at 04:28

1 Answers1

2

Install the pg gem in your Gemfile

gem 'pg'

change the database.yml file to use your database ex.

adapter: postgresql database: db_name pool: timeout: host: localhost username: username password: password set your db_name, username, and password same as postgresql database.

Have fun..