# Problem with render :partial ... :collection

**URL:** <https://www.ruby-forum.com/t/problem-with-render-partial-collection/104220>\
**Category:** Rails\
**Created:** [May 15, 2007, 4:44pm UTC](https://www.ruby-forum.com/t/problem-with-render-partial-collection/104220 "2007-05-15T16:44:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![laurent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ce7236/32.png) [@laurent](https://www.ruby-forum.com/u/laurent)\
**Post date:** [May 15, 2007, 4:44pm UTC](https://www.ruby-forum.com/t/problem-with-render-partial-collection/104220/1 "2007-05-15T16:44:15Z")

</div>

Hello,

I 'm currently developing a fully ajaxified Portal with RoR for a  
client.

In the page, i have an In Place Editing Area :  
Clicking on the area (div), replace it with a content coming from a  
Partial (i’ve extended the component InPlaceEditor from controls.js  
for this)…This first Partial is called A

In this partial A.rhtml, i render a second ‘inner’ partial as :  
render :partial=\> ‘display\_row’, :collection=\>@my\_collection

My ‘display\_row’ inner partial includes the following code :

blah blah

blah blah

But when testing in the browser, and checking generated code with  
Firebug, i do not see any node in my HTML page…seems to  
have been skipped

This same ‘display\_row’ inner partial is reused directly from RJS (in  
the controller) :  
render :update do |page|  
page.insert\_html :bottom, “container”, :partial =\> “display\_row”  
end

In this second case it works…i can see the node in the  
generated HTML

Are there limitations with partials rendered from another partial?

Thanks

Laurent

---

<div class="post-metadata">

**Author:** ![laurent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ce7236/32.png) [@laurent](https://www.ruby-forum.com/u/laurent)\
**Post date:** [May 15, 2007, 5:33pm UTC](https://www.ruby-forum.com/t/problem-with-render-partial-collection/104220/2 "2007-05-15T17:33:23Z")

</div>

When rendering through partials, tags are stripped out of the  
resulting source and the javascript inside said tags is executed (unless  
of  
course evalScripts is set to false, default is obviously true).

I wouldn’t worry about it too much, though do make note that if you are  
trying to define a javascript function in a partial’s script tags, it  
most  
likely won’t work (at least, I haven’t figured out how). So in this case  
you  
need to define the function in the initial page HTML, or in javascript  
includes.

Jason

---

<div class="post-metadata">

**Author:** ![laurent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ce7236/32.png) [@laurent](https://www.ruby-forum.com/u/laurent)\
**Post date:** [May 16, 2007, 7:11am UTC](https://www.ruby-forum.com/t/problem-with-render-partial-collection/104220/3 "2007-05-16T07:11:29Z")

</div>

Jason,

I suppose doing a Ruby helper on top of my Javascript won’t help  
In any case, the generated tag will be stripped out

Laurent
