My bad,
<%= listshop["test"] %> should be <%= test %>
On Jun 6, 5:03 pm, "Carl H."
<charr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> It looks like there is a problem passing an array of hash to a partial
> render via a collection.
>
> I am trying to do the following:
>
> <%= render :partial => "listshop", :collection => @pca
%>
>
> and @pca has the following:
>
> @pca = Array.new
> @pca << Hash["test" => "1"]
> @pca << Hash["test" => "2"]
>
> and in _listshop.erb, I have the following:
> <%= listshop["test"] %>
>
> I get an "You have a nil object when you didn''t expect
it!" error. If
> I pass a value instead of a hash it works fine and if I manually
> iterate through the array it works fine as well.
>
> Anybody knows why? Am I doing something wrong?
>
> /Carl
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---