Passing hashes in a :collection

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.

On May 16, 2007, at 8:26 AM, [email protected] 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs