Accessing rails render method outside of view / Decorating r

I’m developing a plugin for rails that ultimately needs to assign some
HTML to a javascript variable. In the interest of DRY, I want to be
able to basically specify a partial and pass in a collection and then
render the results. Because I’m assigning the output to a variable
though I need to catch it and escape things like single quotes. The
two options I can immediately see are:

  1. Create a method similar to render in my own class. This would do
    the required operations on my object and then delegate the processing
    to render in ActionView. My problem is, how do I actually call the
    render method from within my own class?

  2. Decorate the existing render method to recognise if my new object
    type is passed in and react accordingly. My problem is, how do I do
    that exactly? And in such away that if another developer wanted to do
    the same thing it would then wrap both of our render methods and not
    just overwrite the others?

Make sense? Any insight greatly appreciated