Hello!
So I’ve got a confusing situation… I’ve got some controllers
namespaced by account types, for example “Buyer” and “Seller”. I want
to have some controllers in either namespace look in a common
directory first for views and then within their namespaced views. I
can’t figure out how to do this, though. I can set a global
before_filter and append or prepend to the view_path. For example, if
I have:
Seller::UsersController < ApplicationController
def index
end
end
Then I get:
Missing template seller/users/index.html.erb in view path …/
myrailsapp/app/views:/…myrailsapp/app/views/common
See the problem? It’s looking in “seller/users”, not just “users”, so
even if I move the code into app/views/common, it would need to be in
“app/views/common/sellers/users/” which doesn’t make it common across
sellers and buyers.
What I’m trying to do is have the above scenario use a view path as:
[/app/views/sellers/users/, /app/views/common/users/]
That way, I can put common code in common for user views across the
namespaces, but then if I want, I can put a view in the namespaced
path and it will pick that up first.
I’m assuming (hoping?) there’s some way to tell a namespaced
controller to not look in the namespaced view path?
Thanks for any help anyone can provide,
-Danimal