Hi Robert,
You can set this up using the layout method. In your application
controller, you would specify:
layout :set_layout
And then, define a method called set_layout, like so (untested):
def set_layout
"domain1.com_layout" if request.host == "domain1.com"
"domain2.com_layout" if request.host == "domain2.com"
end
Tom
On 10/18/05, Robert <mannl-KK0ffGbhmjU@public.gmane.org>
wrote:> Hi!
>
> I want a controller''s actions to be rendered using a different
layout
> depending on the called domain.
>
> E.g. I have these files in app/views/layouts:
>
> domain1.com_layout.rhtml
> domain2.com_layout.rhtml
>
> Now when I call for example: http://www.domain1.com/users/list, I
> want it to be rendered using the domain1 layout, and when http://
> www.domain2.com/users/list is called, I want it to be rendered using
> the domain2 layout.
>
> domain1.com. and domain2.com. point at the same machine of course.
>
>
>
> Any ideas?
>
>
> Thanks a bunch :)
> Rob
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>