Multiple Domains Different Layouts

Hey everyone,
How do I do a before_filter @request.env[‘HOST’] = “somesite.com” and
tell it to display a different layout based on the requested domain?

Thanks,

Sean McGilvray

On Wed, Oct 7, 2009 at 12:02 PM, Sean McGilvray [email protected]
wrote:

How do I do a before_filter @request.env[‘HOST’] = “somesite.com” and
tell it to display a different layout based on the requested domain?

In your controller…

:layout => :calculate_layout

private

def calculate_layout
request.env[‘HOST’] == “somesite.com” ? :foo : :bar
end

http://api.rubyonrails.org/classes/ActionController/Layout/ClassMethods.html


Greg D.
http://destiney.com/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs