Due to the mistakes of the company before I joined I am stuck with a
multiple database setup. I am planning on parsing the REQUEST_URL to
decide which controller is being accessed and basing the
establish_connection on that. Before I go messing around with regexps I
was wondering if rails has a built in function for parsing URLS. I have
googled around a bit and seen net/http but I cannot find an API for it.
Due to the mistakes of the company before I joined I am stuck with a
multiple database setup. I am planning on parsing the REQUEST_URL to
decide which controller is being accessed and basing the
establish_connection on that. Before I go messing around with regexps I
was wondering if rails has a built in function for parsing URLS. I have
googled around a bit and seen net/http but I cannot find an API for it.
The request URL is chopped up by config/routes.rb. Iād start there.
Due to the mistakes of the company before I joined I am stuck with a
multiple database setup. I am planning on parsing the REQUEST_URL to
decide which controller is being accessed and basing the
establish_connection on that. Before I go messing around with regexps I
was wondering if rails has a built in function for parsing URLS. I have
googled around a bit and seen net/http but I cannot find an API for it.
The request URL is chopped up by config/routes.rb. Iād start there.
I found out about require āURIā and ended up using that.
class ApplicationController < ActionController::Base
before_filter :change_database
Due to the mistakes of the company before I joined I am stuck with a
multiple database setup. I am planning on parsing the REQUEST_URL to
decide which controller is being accessed and basing the
establish_connection on that. Before I go messing around with regexps I
there are easier ways to determine the controllerā¦
params[:controller] in a before_filter should do the trickā¦