I know that you have already accepted the answer for this, but I don’t think you need to create your own template resolver.
If I understand your question correctly, you are trying to “tag” your views depending on some aspect of the current state of the application. I did the same as before using this dandy little controller method:
prepend_view_path "app/views/#{current_app_code}"
Do this in the before_filter file in your application controller and all your controllers will obey:
class ApplicationController < ActionController::Base before_filter :prepend_view_paths def prepend_view_paths prepend_view_path "app/views/
Now the rails will first search for “app / views / app1 / users / index.html.erb” when “/ users” is requested if “app1” is the current application.
If he does not find it there, he returns to the default location in "app / views / users / index.html.erb".
Hope this gives you another alternative.
source share