# Calling controller without a web request

**URL:** <https://www.ruby-forum.com/t/calling-controller-without-a-web-request/143470>\
**Category:** Rails\
**Created:** [July 18, 2008, 11:41pm UTC](https://www.ruby-forum.com/t/calling-controller-without-a-web-request/143470 "2008-07-18T23:41:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sp00nyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@sp00nyg](https://www.ruby-forum.com/u/sp00nyg)\
**Post date:** [July 18, 2008, 11:41pm UTC](https://www.ruby-forum.com/t/calling-controller-without-a-web-request/143470/1 "2008-07-18T23:41:34Z")

</div>

I’m building a RoR service using Facebook’s Thrift. Ideally, I would  
like one of my service methods to be able to call a controller method  
that does a render\_to\_string so I can return an HTML snippet from my  
service. Without a web Request object, is it possible to call a  
controller method? In understand I could use ERB directly to apply a  
template, but writing test code for my service would be better if I  
could use functional tests. Plus, it would be nice to use a more  
standard mechanism to render my snippets.
