Tom Copeland wrote: > On Mon, 2008-02-25 at 20:19 +0100, Lucas Campbell wrote: >> I am deploying an application to several sub domains and need to set a >> global variable in each sub domain so that I query the correct table >> based on the sub domain. > > Hm, sounds like something you could do in a controller - just check the > "Host" header of the incoming HTTP request. > > Yours, > > tom
I actually created a helper method that uses url_for to grab the url and find out which subdomain its in and then set the global variable accordingly. I can't access helper methods from my controller so I am using my layout to call my helper method which sets the global varialbe. Only thing is, since i call the helper from my layout, it is being called every time a page is rendered. I wanted to find a way to add something in my deploy.rb file to call the helper method once so the global is set. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Deploying Rails" group. To post to this group, send email to rubyonrails-deployment@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-deployment?hl=en -~----------~----~----~----~------~----~------~--~---