# Passing hashes in a :collection

**URL:** <https://www.ruby-forum.com/t/passing-hashes-in-a-collection/104275>\
**Category:** Rails\
**Created:** [May 16, 2007, 8:27am UTC](https://www.ruby-forum.com/t/passing-hashes-in-a-collection/104275 "2007-05-16T08:27:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 16, 2007, 8:27am UTC](https://www.ruby-forum.com/t/passing-hashes-in-a-collection/104275/1 "2007-05-16T08:27:34Z")

</div>

I am trying to pass an array of hashes to a partial via a :collection.

render :partial =\> ‘property’, :collection =\> @enriched\_properties

where @enriched\_properties is an array of hashes:

:property =\> property # a property object  
:is\_visible =\> property.visible?(member)

and so on…

In my partial, the local variable “property” is only showing the  
contents of the property object.

I am not able, for example, to say \<%= h property[:is\_visible].inspect  
%\>

Thanks.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 16, 2007, 8:45am UTC](https://www.ruby-forum.com/t/passing-hashes-in-a-collection/104275/2 "2007-05-16T08:45:35Z")

</div>

On May 16, 2007, at 8:26 AM, removed\_email\_address@domain.invalid wrote:

> and so on…
> 
> In my partial, the local variable “property” is only showing the  
> contents of the property object.
> 
> I am not able, for example, to say \<%= h property[:is\_visible].inspect  
> %\>

Yeah, hashes do not work because the code behind render collection  
handles them as a special case. Replace the call with an explicit loop.

– fxn
