Michal Gabrukiewicz
2007-Dec-17 13:07 UTC
rendering a partial with locals from applicat_helper
i have the following method in my application_helper.rb def test render(:partial => ''/application/errors'', :locals => { :detail_msgs => ''testing...'', :headline => [''asd'', ''wwww''], :msgs => [''adssaad'']}) end when I call this within one of my views it does not recognize the locals and it results in an error that the var does not exists. when i remove the vars within the partial then its rendered fine .. but i need the locals there i am using rails 2.0.1 thx for any 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?hl=en -~----------~----~----~----~------~----~------~--~---
Michal Gabrukiewicz
2007-Dec-17 14:56 UTC
Re: rendering a partial with locals from applicat_helper
i took me quite a while to find the problem but finally i found the "stupid" mistake ... within the partial i used the locals as instance vars instead of common vars .. so instead <%= @headline %> i use <%= headline %> yep .. now i wont forget this for sure :) solved -- 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 -~----------~----~----~----~------~----~------~--~---