I have an app that varies its content based upon the domain from which
it is being accessed. Some of the domain characteristics are
supported in the model but it is easier varying static text in the
views and then sharing the form templates via partials etc.
Rails 2.3.10 and looking at the documentation at
before_filter :domain_lookup, :set_view_paths
according to the documentation this should add this path to the front
of the search order for this request only (as opposed to the similar
class method which prepends for all future requests)
I would expect the template to be rendered for the controller from app/
views/quote/type1/new.html.erb if it exists, if it does not exist it
will fall back to app/views/quote/new.html.erb
When I GET http://domain1:3000/quote/new it always renders app/views/
quote/new.html.erb and in the log I can see
Processing QuoteController#new (for 192.168.1.24 at 2011-02-21
Domain Load (0.2ms) SELECT * FROM “domains” WHERE
(“domains”.“host” = ‘example.com’) LIMIT 1
Policy Load (0.2ms) SELECT * FROM “policies” WHERE
(“policies”.“id” = 6)
Rendering template within layouts/application
which is incorrect.
In my development environment I also render a debug partial and in it
<%= self.view_paths %>
which renders the pathset object.
Has anyone got this working? I was thinking of over-riding render but
am wary of any side effects.