Hi all, I''m getting an error and I really don''t know why, because I seem to be doing everything well..I pass "testvar" as a variable to render partial: <%= render(:partial => "main/categorysmallitem", :collection => group_of_four, :locals => {:testvar=>"AA"})%> But then, when I try to use testvar inside the partial, it doesn''t recognize it: <%= testvar %> I get the error: undefined local variable or method `testvar'' for #<#<Class:0xb743eff4>:0xb743efcc> Thanks a lot Victor -- 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 -~----------~----~----~----~------~----~------~--~---
I''m having the same problem! render :partial isn''t working as advertised in this case. Would anybody have ideas? This is driving me nuts. I''ll try the latest rails gem to see if that helps.. I''ll post again if so.. arrrrghh.. -- Dan Victor wrote:> I''m getting an error and I really don''t know why, because I seem to be > doing everything well..I pass "testvar" as a variable to render partial: > > <%= render(:partial => "main/categorysmallitem", :collection => > group_of_four, :locals => {:testvar=>"AA"})%> > > But then, when I try to use testvar inside the partial, it doesn''t > recognize it: > > <%= testvar %> > > I get the error: > undefined local variable or method `testvar'' for > #<#<Class:0xb743eff4>:0xb743efcc>--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I just tried v1.1.6, and no dice -- I''m not seeing local variables in my partial templates. HELP! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I am running a newer revision of edge and I am having this same problem. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
wait, nope...it does work. Looks like its fixed in the later edge, I am running 5196. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
The problem in my case was purely ''inattentiveness'': my partial was not called by the code passing the locals. I would try to debug your code flow to see if you really are calling the partial from where you think you are. good luck Victor Dan Caugherty wrote:> I just tried v1.1.6, and no dice -- I''m not seeing local variables in > my partial templates. > > HELP!-- 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 -~----------~----~----~----~------~----~------~--~---