# How to find current template

**URL:** <https://www.ruby-forum.com/t/how-to-find-current-template/120932>\
**Category:** Rails\
**Created:** [November 21, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/how-to-find-current-template/120932 "2007-11-21T21:42:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![praveen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ec8ea/32.png) [@praveen](https://www.ruby-forum.com/u/praveen)\
**Post date:** [November 21, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/how-to-find-current-template/120932/1 "2007-11-21T21:42:31Z")

</div>

Hi  
How do I find out the template that’s going to be rendered, in a  
controller action? I need to render the template to a string and send  
the resulting string via JSON. I need to do this in app/controller/  
application.rb so each controller method doesn’t know it’s happening.

Thanks
