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

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -