-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

1 Answer 1

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..

Sign up to request clarification or add additional context in comments.

1 Comment

Hello vishal dhanopia, Thanks for your reply. But i have used mysql database.. so is it possible for Mysql?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.