One option is to create a view folder for each sub-domain app/views/admin
and put all the view files for that sub-domain in it e.g. app/views/admin/foos/index.html.erb
.
Then use the prepend_view_path
to change the path based on the sub-domain like this:
class ApplicationController < ActionController::Base
before_filter :prepend_view_paths
def prepend_view_paths
subdomain = request.subdomain
prepend_view_path "app/views/#{subdomain}"
end
end
The prepend method adds the given path to front of the queue and if it is not found, it searches for the file in the default paths.
Warning: Code not tested