tags:

views:

46

answers:

1

I've got a template for a partial that I'd like to use and I'm wondering if it's possible to just render the thing without needing to send a mock request to a controller. I'm never going to need to render this to an AJAX call, so it seems silly to set up a controller and action, not to mention the security issues with making a private partial open to the world.

+1  A: 

I think you need render_view. It skips both layout and controller action.

huma
That is really close, but it still requires an action on the controller. You can usually get away with it if the partial is in the same directory, because then your controller is the current one, and the action is the name of the file. However, you can't call that with an arbitrary path to a template file, which is a shame.
Ah, that would be [render_file](http://doc.rubyists.com/ramaze%2binnate/Innate/Helper/Render.html#render_file-instance_method). It takes a path to a template to render.
huma