# Partials and content\_for

**URL:** <https://www.ruby-forum.com/t/partials-and-content-for/59017>\
**Category:** Rails\
**Created:** [April 27, 2006, 10:30pm UTC](https://www.ruby-forum.com/t/partials-and-content-for/59017 "2006-04-27T22:30:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [April 27, 2006, 10:30pm UTC](https://www.ruby-forum.com/t/partials-and-content-for/59017/1 "2006-04-27T22:30:56Z")

</div>

let’s say i’ve got a partial that looks like this:

\<% content\_for :foo do -%\>  
partial.id  
\<% end -%\>

then the following works:  
\<%= render :partial =\> “partial”, :collection =\> @collection %\>  
\<%= @content\_for\_foo %\>

but this does not:  
\<%= @content\_for\_foo %\>  
\<%= render :partial =\> “partial”, :collection =\> @collection %\>

is there any way to get my @content\_for to show up in the html output  
above where the partial is rendered in the rhtml template?

thanks
