i can''t get rid of the following error: ActionView::TemplateError (undefined local variable or method `order_line'' for #<#<Class:0xb75b2090>:0xb75b1f28>) on line #13 of app/views/admin/_order_line.rhtml: 10: 11: <tr valign="top"> 12: <td> 13: <div class="olnamebox"><%= h(order_line.name) %></div> 14: <div class="oladdress"><%= h(order_line.address) %> </div> 15: </td> The partial is called from within a view (ship.rhtml): <%= render(:partial => "order_line", :collection => @pending_orders) %> The PragProg-Rails book explains the following: ''''The order_line parameter also tells Rails to set a local variable called order_line to the value of the order currently being rendered. This variable is available only inside the partial template.'''' So why do i get the error above?? By the way: is it right that i get a blank page or should i see an error-page from rails? scrolling down my development.log is see the following: ActionView::ActionViewError (No rhtml, rxml, or delegate template found for /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2 /lib/action_controller/templates/rescues/template_error.rhtml): /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:281:in `pick_template_extension'' Any hints? Regards, Torsten _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
having trouble with that page as well but I am getting this error You have a nil object when you didn''t expect it! The error occured while evaluating nil.name Not sure why your getting that error that is strange. Brian On 12/18/05, Torsten Schmidt <torstello-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > i can''t get rid of the following error: > > ActionView::TemplateError (undefined local variable or method `order_line'' > for #<#<Class:0xb75b2090>:0xb75b1f28>) on line #13 of app/views/admin/ > _order_line.rhtml: > 10: > 11: <tr valign="top"> > 12: <td> > 13: <div class="olnamebox"><%= h(order_line.name) %></div> > 14: <div class="oladdress"><%= h(order_line.address) %> </div> > 15: </td> > > > The partial is called from within a view (ship.rhtml): > > <%= render(:partial => "order_line", :collection => @pending_orders) %> > > > The PragProg-Rails book explains the following: > > ''''The order_line parameter also tells Rails to set a local variable called > order_line to the value of the order currently being rendered. This variable > is available only inside the partial template.'''' > > So why do i get the error above?? > > > By the way: is it right that i get a blank page or should i see an > error-page from rails? > scrolling down my development.log is see the following: > > ActionView::ActionViewError (No rhtml, rxml, or delegate template found > for /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2 > /lib/action_controller/templates/rescues/template_error.rhtml): > /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:281:in > `pick_template_extension'' > > > Any hints? > > Regards, > Torsten > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Spectre013 wrote:> having trouble with that page as well but I am getting this error > > You have a nil object when you didn''t expect it! > The error occured while evaluating nil.name > > Not sure why your getting that error that is strange. > > BrianDoes anyone know what the fix for this is? I''m following along with the first addition of agile web development with rails and it''s been going great until I got to page 118 and ran into the exact problem described above. _order_line.rhtml: <tr valign="top"> <td> <div class="olnamebox"><%= h(order_line.name) %></div> <div class="oladdress"><%= h(order_line.address) %> </div> </td> ship.rhtml <%= render(:partial => "order_line", :collection => @pending_orders) %> The error is: You have a nil object when you didn''t expect it! The error occured while evaluating nil.name Any help would much appreciated. -Theron -- 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 figured out the problem....it turns out that I had named a variable in my order model <at>pending_order and named it <at>pending_orders in my admin_controller so it wasn''t sending anything to my partial. That was a fun two hours that I''ll never get back. :) Game on. -- 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 -~----------~----~----~----~------~----~------~--~---