ruby - Rails database name dynamically by user choice in Mongodb -


while installing app , want ask question name of database? , user input name want database. database name inside config/mongoid.yml

development:        sessions:     default:           database: project_development           hosts:         - localhost:27017       options: 

i want make database project_development dynamically user input while performing bundle install or before bundle install app.is there steps make happen?

if config/mongoid.yml passed through erb config/database.yml is, can following trick:

development:    sessions: default:       database: <%= env['mongo_db_name'] || 'default_db_name' %>       hosts:     - localhost:27017   options: 

then start rails mongo_db_name=some_name rails s. if omit mongo_db_name startup, fallback default_db_name.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -