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
on 2006-02-08 18:23
on 2006-02-08 18:37
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.
on 2006-02-08 21:34
Hi Tom, Thank you for your reply. I was interested in understanding the concept so your reply did help. Thanks Frank Tom M. <email@example.com> wrote: Not worth it, if you ask me.