# render\_to\_string undefined??

**URL:** <https://discuss.rubyonrails.org/t/render-to-string-undefined/10709>\
**Category:** rubyonrails-talk\
**Created:** [March 23, 2007, 10:09pm UTC](https://discuss.rubyonrails.org/t/render-to-string-undefined/10709 "2007-03-23T22:09:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_E\_G\_Lynch](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@Paul\_E\_G\_Lynch](https://discuss.rubyonrails.org/u/Paul_E_G_Lynch)\
**Post date:** [March 23, 2007, 10:09pm UTC](https://discuss.rubyonrails.org/t/render-to-string-undefined/10709/1 "2007-03-23T22:09:56Z")

</div>

Do I need to include anything special in order to call render\_to\_string from the view? When I try to do something like this in my rhtml template:

\<%= render\_to\_string(:partial =\> "user\_description") %\>

I get the error:

undefined method `render\_to\_string' for #\<#\<Class:0xb76e9134\>: 0xb76e910c\>

followed by an excerpt from my template. Do I have something wrong with the syntax?

Thanks, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--Paul

---

<div class="post-metadata">

**Author:** ![Paul\_E\_G\_Lynch](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@Paul\_E\_G\_Lynch](https://discuss.rubyonrails.org/u/Paul_E_G_Lynch)\
**Post date:** [March 23, 2007, 10:17pm UTC](https://discuss.rubyonrails.org/t/render-to-string-undefined/10709/2 "2007-03-23T22:17:24Z")

</div>

I think I have found the answer-- apparently in the view templates, you just call "render" and not "render\_to\_string". The explanation for this is probably that in the view you always want to render to a string, but I'm not sure. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--Paul
