Hey, Just thought I''d see how easy it was to use erubis rather than erb in rails, and so far all seems to be pretty easy. Just added a few lines in environment.rb and everything works as before. However, one page is causing a problem. It is a partial that is being passed a local variable. erubis doesn''t seem to see the local, and gives the following error? undefined local variable or method `page'' for #<Erubis::Helper::RailsTemplate:0x27557fc> Even though the partial is being rendered from another page with the following statement: <%= render :partial => ''node'', :locals => { :page => @home_page } %> Any ideas how you can pass a local to a partial when using erubis? Thanks, Mark -- 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 -~----------~----~----~----~------~----~------~--~---
I just ran across the same error without even calling the local from the partial itself. It seems like just creating the local raises the error. Oh fun! A bug to fix for Christmas! Yay! RSL On 12/22/06, Mark Dodwell <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hey, > > Just thought I''d see how easy it was to use erubis rather than erb in > rails, and so far all seems to be pretty easy. Just added a few lines in > environment.rb and everything works as before. > > However, one page is causing a problem. It is a partial that is being > passed a local variable. erubis doesn''t seem to see the local, and gives > the following error? > > undefined local variable or method `page'' for > #<Erubis::Helper::RailsTemplate:0x27557fc> > > Even though the partial is being rendered from another page with the > following statement: > > <%= render :partial => ''node'', :locals => { :page => @home_page } %> > > Any ideas how you can pass a local to a partial when using erubis? > > Thanks, > > Mark > > -- > 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 -~----------~----~----~----~------~----~------~--~---
There''s already a patch put in for it. http://rubyforge.org/tracker/index.php?func=detail&aid=6726&group_id=1320&atid=5203 But it doesn''t look like anyone official has looked at it or anything. I applied the patch and voila! It works! Hope you get the same result. RSL Mark Dodwell wrote:> Hey, > > Just thought I''d see how easy it was to use erubis rather than erb in > rails, and so far all seems to be pretty easy. Just added a few lines in > environment.rb and everything works as before. > > However, one page is causing a problem. It is a partial that is being > passed a local variable. erubis doesn''t seem to see the local, and gives > the following error? > > undefined local variable or method `page'' for > #<Erubis::Helper::RailsTemplate:0x27557fc> > > Even though the partial is being rendered from another page with the > following statement: > > <%= render :partial => ''node'', :locals => { :page => @home_page } %> > > Any ideas how you can pass a local to a partial when using erubis? > > Thanks, > > Mark-- 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 -~----------~----~----~----~------~----~------~--~---