# Any way around using only 1 render per action?

**URL:** <https://www.ruby-forum.com/t/any-way-around-using-only-1-render-per-action/192597>\
**Category:** Rails\
**Created:** [August 2, 2010, 8:27pm UTC](https://www.ruby-forum.com/t/any-way-around-using-only-1-render-per-action/192597 "2010-08-02T20:27:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adistarmid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Post date:** [August 2, 2010, 8:27pm UTC](https://www.ruby-forum.com/t/any-way-around-using-only-1-render-per-action/192597/1 "2010-08-02T20:27:11Z")

</div>

My program needs to use a render in a controller action. The problem  
is that the action makes a user list and sends it to wicked\_pdf, which  
uses a render, causing an error if I use one also. Does anyone know a  
way around this, and is the render I’m using totally necessary?? Here  
is my controller code.

```
@households = Household.find(:all, :order => "last_name,

```

first\_name")  
@households.each { |@household|  
@today = Date.today  
@year = @today.year  
@thisyear =  
Visit.find\_all\_by\_year\_and\_household\_id(Date.today.year,  
@household.id)  
@lastyear =  
Visit.find\_all\_by\_year\_and\_household\_id(Date.today.year-1,  
@household.id)  
@yearbefore =  
Visit.find\_all\_by\_year\_and\_household\_id(Date.today.year-2,  
@household.id)  
render( :action=\>:printone)  
}  
date=`date +%Y%m%d-%H:%M`  
respond\_to do |format|  
format.pdf { send\_data render\_to\_pdf( :action =\> ‘print’,  
:layout =\> ‘pdf\_report’),  
:filename =\>  
“Household\_List\_for\_” + date }

as the name says, print\_one does 1 page of the report for 1 user. It  
needs the above variables to do the page.

```
                                      Thanks for the help

                               Bob S. <removed_email_address@domain.invalid>
```

---

<div class="post-metadata">

**Author:** ![adistarmid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@adistarmid](https://www.ruby-forum.com/u/adistarmid)\
**Post date:** [August 2, 2010, 8:30pm UTC](https://www.ruby-forum.com/t/any-way-around-using-only-1-render-per-action/192597/2 "2010-08-02T20:30:41Z")

</div>

On 2 August 2010 19:26, Bob S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Does anyone know a way around this

render( :action=\>:printone) and return

> and is the render I’m using totally necessary??

possibly… but I’m not familiar with “wicked\_pdf”, so can’t say for  
sure.

Are you following whatever guidelines they give in their documentation  
for integrating with Rails?
