I’m brand new to ROR so sorry for the noob question. Been searching the
for this one but haven’t been able to figure it out.
My ROR application talks to an existing database. Yup I figured out how
make ActiveRecord work with tables that already exist and don’t play to
naming convention of rails, all good there.
What makes my existing situation tricky is that my server has a number
copies of the same database but I need to access one of those databases
based on the URL
There are two parts to this puzzle.
- how do I access and parse the hostname to obtain the database name ?
- how do I then use this name in database.yml ?
I’m using Rails 4 btw.
Thanks for any pointers!