I have a partial template file (acutally, it is an RJS file but the
same principle is in question here) which I wish to “share” between
multiple controllers. Does anyone know where in the directory tree I
would put these files in order that I can access them from multiple
controllers in the same app? I really would prefer not having to copy
them all into all of the directories. I guess what I am looking for is
a “mixin” type thing for views. I tried putting them in a directory
called “application” under views, but that didn’t work.
I have a partial template file (acutally, it is an RJS file but the
same principle is in question here) which I wish to “share” between
multiple controllers. Does anyone know where in the directory tree I
would put these files in order that I can access them from multiple
controllers in the same app?
I stick them in a “shared” folder, then call out to them like this:
On Wed, Mar 14, 2007 at 10:40:48PM -0000, P² wrote :
I guess what I am looking for is
a “mixin” type thing for views. I tried putting them in a directory
called “application” under views, but that didn’t work.
I put my shared views rjs/templates in app/view/shared/
For other snippets, put them in lib/* and add a ‘require your_file’ at
the beginning of your controller, or, if you’re playing with modules,
‘include my_module’ after the beginning of your ApplicationController.