# Render :partial

**URL:** <https://www.ruby-forum.com/t/render-partial/173029>\
**Category:** Rails\
**Created:** [July 31, 2009, 6:03pm UTC](https://www.ruby-forum.com/t/render-partial/173029 "2009-07-31T18:03:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fisa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/49beb7/32.png) [@fisa](https://www.ruby-forum.com/u/fisa)\
**Post date:** [July 31, 2009, 6:03pm UTC](https://www.ruby-forum.com/t/render-partial/173029/1 "2009-07-31T18:03:48Z")

</div>

hi everybody,

I want to pass object to a partial which execute as a collection.here is  
may code

render :partial =\> “added\_ads”,:collection=\>@ads.

here i want pass @ad object to each added\_ads partial

please help me

---

<div class="post-metadata">

**Author:** ![fisa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/49beb7/32.png) [@fisa](https://www.ruby-forum.com/u/fisa)\
**Post date:** [July 31, 2009, 6:20pm UTC](https://www.ruby-forum.com/t/render-partial/173029/2 "2009-07-31T18:20:05Z")

</div>

yup, you can just pass it like any other variable for example the code  
look  
like this.  
render :partial =\> “added\_ads”,:local =\> {::ad =\> @ad}:collection=\>@ads.

On Fri, Jul 31, 2009 at 9:33 PM, Md Fisa

---

<div class="post-metadata">

**Author:** ![fisa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/49beb7/32.png) [@fisa](https://www.ruby-forum.com/u/fisa)\
**Post date:** [July 31, 2009, 6:41pm UTC](https://www.ruby-forum.com/t/render-partial/173029/3 "2009-07-31T18:41:05Z")

</div>

Lakshmi N. wrote:

> yup, you can just pass it like any other variable for example the code  
> look  
> like this.  
> render :partial =\> “added\_ads”,:local =\> {::ad =\> @ad}:collection=\>@ads.
> 
> On Fri, Jul 31, 2009 at 9:33 PM, Md Fisa

Thank you for you replay  
I got it .i named my partial as \_ad then

render :partial=\>“ad”,:collection=\>@ads

Anyways thank you for quick replay nd i will try your code also.
