Hi, After using rails for a while, I''ve decided to ''sex-up'' my apps using the built in AJAX support. I seem to have struck a problem which is probably my own oversight. When I make a call to link_to_remote, I want to send an :id to the action. When this is handled by a stadard link_to call, it''s fine. Using link_to_remote causes the error: ''You have a nil object when you didn''t expect it!''. In summary: <%= link_to ''Capabilities'', :action => ''capabilities'', :id => @mything %> ...is OK, but... <%= link_to_remote("Capabilities", :update => ''mydiv'', :url => { :action => ''capabilities'', :id => @mything }) %> ...does not. Maybe i''m just too old and my head is wired for Web 1.0 :) Thanks for any help anyone can give. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
dblack-TKXtfPMJ4Ozk1uMJSBkQmQ@public.gmane.org
2006-Oct-21 12:21 UTC
Re: link_to_remode :id
Hi -- On Sat, 21 Oct 2006, karma_guru wrote:> > Hi, > > After using rails for a while, I''ve decided to ''sex-up'' my apps using > the built in AJAX support. > > I seem to have struck a problem which is probably my own oversight. > > When I make a call to link_to_remote, I want to send an :id to the > action. When this is handled by a stadard link_to call, it''s fine. > Using link_to_remote causes the error: ''You have a nil object when you > didn''t expect it!''. > > In summary: > > <%= link_to ''Capabilities'', :action => ''capabilities'', :id => @mything > %> > > ...is OK, but... > > <%= link_to_remote("Capabilities", > :update => ''mydiv'', > :url => { :action => ''capabilities'', :id => @mything }) %> > > ...does not.Where is the error being raised from? David -- David A. Black | dblack-TKXtfPMJ4Ozk1uMJSBkQmQ@public.gmane.org Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB''s Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---