# Invoke render multiple times

**URL:** <https://www.ruby-forum.com/t/invoke-render-multiple-times/53630>\
**Category:** Rails\
**Created:** [February 12, 2006, 11:11am UTC](https://www.ruby-forum.com/t/invoke-render-multiple-times/53630 "2006-02-12T11:11:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@marcan](https://www.ruby-forum.com/u/marcan)\
**Post date:** [February 12, 2006, 11:11am UTC](https://www.ruby-forum.com/t/invoke-render-multiple-times/53630/1 "2006-02-12T11:11:53Z")

</div>

I need to invoke render() multiple times. This is not to render a  
response to the browser but to get the result of render() and put it in  
files. Is there another way to do it if it’s not possible to do it  
directly with render()?

Btw, what’s the reasoning behind only allowing render() to be called  
once a request?

/Marcus

---

<div class="post-metadata">

**Author:** ![marcan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@marcan](https://www.ruby-forum.com/u/marcan)\
**Post date:** [February 12, 2006, 12:00pm UTC](https://www.ruby-forum.com/t/invoke-render-multiple-times/53630/2 "2006-02-12T12:00:40Z")

</div>

Marcus

> I need to invoke render() … to get the result of render() and put  
> it in  
> files. Is there another way to do it if it’s not possible to do it  
> directly with render()?

render\_to\_string  
in ActionController::Base

Alain

---

<div class="post-metadata">

**Author:** ![marcan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@marcan](https://www.ruby-forum.com/u/marcan)\
**Post date:** [February 12, 2006, 5:04pm UTC](https://www.ruby-forum.com/t/invoke-render-multiple-times/53630/3 "2006-02-12T17:04:11Z")

</div>

It works. Thanks

/Marcus

Alain R. skrev:

---

<div class="post-metadata">

**Author:** ![marcan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@marcan](https://www.ruby-forum.com/u/marcan)\
**Post date:** [February 13, 2006, 1:14pm UTC](https://www.ruby-forum.com/t/invoke-render-multiple-times/53630/4 "2006-02-13T13:14:09Z")

</div>

Thank you. That did the trick

/Marcus

Alain R. skrev:
