Hi All, I'm brand new to ROR so sorry for the noob question. Been searching the net 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 to make ActiveRecord work with tables that already exist and don't play to the naming convention of rails, all good there. What makes my existing situation tricky is that my server has a number of copies of the same database but I need to access one of those databases based on the URL So: http://database1.myserver.au/mytable => lists records for mytable in database1 http://database2.myserver.au/mytable => lists records for mytable in database2 There are two parts to this puzzle. 1) how do I access and parse the hostname to obtain the database name ? 2) how do I then use this name in database.yml ? I'm using Rails 4 btw. Thanks for any pointers! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4c3d9a2b-7b1d-48b1-8b20-ed5050bb269a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.