Is there anyway to create an ERb/.rhtml template, telling it to try to
include the contents of another file, and, if not, fallback to a
default?
More specifically, I have the site running under multiple “skins”, for
different brand names. I can illustrate this with an example:
I might have in views:
/views/order/pizza.rhtml
/views/order/coke.rhtml
Now, I may have customized pizza.rhtml for one customer, but not for the
other. So, I’d like rails to first try looking for pizza.rhtml in
/views/customized/joespizza/order/pizza.rhtml, and, if it’s not there,
look in the regular /views/order/pizza.rhtml.
If the BRAND appears in the path, remove it and retry, else, rethrow
What does eveyone think?
Where should this code go in a plugin? (IE, into which class/method)
lstrecv wrote:
Is there anyway to create an ERb/.rhtml template, telling it to try to
include the contents of another file, and, if not, fallback to a
default?
More specifically, I have the site running under multiple “skins”, for
different brand names. I can illustrate this with an example:
I might have in views:
/views/order/pizza.rhtml
/views/order/coke.rhtml
Now, I may have customized pizza.rhtml for one customer, but not for the
other. So, I’d like rails to first try looking for pizza.rhtml in
/views/customized/joespizza/order/pizza.rhtml, and, if it’s not there,
look in the regular /views/order/pizza.rhtml.
Any good way to do this?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.