How to set global variables to use everywhere in my application?

Posted by user502052 on Stack Overflow See other posts from Stack Overflow or by user502052
Published on 2011-03-01T09:16:10Z Indexed on 2011/03/01 23:24 UTC
Read the original article Hit count: 321

I am using Ruby on Rails 3 and I would like to set some global variable to use those everywhere in my application. In particular, the domain name.

If, for example, my website URL is

http://subname.domain.com

I would like to set or retrieve the subname.domain.com value in order to use that in my application like this

request_uri = "http://#{sub_domain_name}"

Where and how I have to state\initialize the sub_domain_name variable or other variables at all?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby