Best way to know the domain across all controllers?

Hello,
I would like to use something like
domain=request.domain
and be able to access the domain variable across all my controllers.

What is the best way to do so? In which file can I put the above
variable declaration and still be able to access it application wide?

I guess I am asking on assistance for using global variables in rails.

Can anyone please guide me to a source or help me figure this out.

Thanks
Frank

application.rb

def set_domain
@domain=request.domain
end

In your controllers…

before_filter :set_domain

All that gets you, though, is the ability to replace:

request.domain

with

@domain

Not worth it, if you ask me.


– Tom M.

Hi Tom,
Thank you for your reply.
I was interested in understanding the concept so your reply did help.

Thanks
Frank

Tom M. [email protected] wrote: Not worth it, if you ask
me.