when i use a partial render with a collection and a hash of locals, i don''t get the locals. <%= render :partial => ''/users/user'', :collection => @users, :locals => {:test_value => true} %> isn''t it possible to use both collection and locals with a render? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jean-sébastien Jney wrote:> when i use a partial render with a collection and a hash of locals, i > don''t get the locals. > <%= render :partial => ''/users/user'', :collection => @users, :locals > => {:test_value => true} %> > isn''t it possible to use both collection and locals with a render?This works fine for me. When you access the locals, you''re just using eg <%= test_value %> rather than <%= locals[:test_value] %> right? -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Max Williams wrote:> Jean-sébastien Jney wrote: >> when i use a partial render with a collection and a hash of locals, i >> don''t get the locals. >> <%= render :partial => ''/users/user'', :collection => @users, :locals >> => {:test_value => true} %> >> isn''t it possible to use both collection and locals with a render? > > This works fine for me. When you access the locals, you''re just using > eg > > <%= test_value %> > > rather than > > <%= locals[:test_value] %> > > right?My mistake, i''m talking out my ass, sorry (not had my morning coffee yet) -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---