I tried calling something like this in my view: <%= render :partial => ''foo'', :collection => [{1=>2}, 3] %> And the partial doesn''t seem to be getting the first Hash object in the array. Anyone else experienced this? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Mar-20 08:17 UTC
Re: Cannot call render :partial :collection with an Array of Hash?
On 19 Mar 2008, at 22:31, Eric wrote:> > I tried calling something like this in my view: > > <%= render :partial => ''foo'', :collection => [{1=>2}, 3] %> > > And the partial doesn''t seem to be getting the first Hash object in > the array.There''s this note in partials.rb which may or may not explain this: # NOTE: Due to backwards compatibility concerns, the collection can''t be one of hashes. Normally you''d also just keep domain objects, # like Active Records, in there. Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Danny Burkes
2008-Mar-20 12:08 UTC
Re: Cannot call render :partial :collection with an Array of
> And the partial doesn''t seem to be getting the first Hash object in > the array.This seems relevant: http://blog.hypsometry.com/archives/2007/10/26/rendering_a_collection_of_things/ - Danny -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---