I am a new comer to Rack and then try to get my mind around it running Ruby on Rails 3...beta4.
I am beginning a Rack application within the config.ru file but want to make use of a variable there that's saved during my database. Could it be even possible to obtain a database value back prior to the application is loaded or shall we be held missing the purpose completely?
I am while using Rack Google Analytics jewel and need to get the UA key in the database:
require "rack-google-analytics" use Rack::GoogleAnalytics, :tracker => "UA-xxxxx-x"
Obviously you can do someting like this
require "rack-google-analytics" require "active_record" ActiveRecord::Base.establish_connection ... ... use Rack::GoogleAnalytics, :tracker => "UA-xxxxx-x"
however, you should understand than all code over line
use Rack::GoogleAnalytics, :tracker => "UA-xxxxx-x"
is going to be performed only one time, whenever your web server is beginning