Hi, I wish to have a link_to_remote tag with a :url to another controller. Strangely its not working. Am I missing a point here?i.e. is it designed such? What I have now is in a view of controller ''one'': <% link_to_remote("link", :update => ''div'', :url => {:controller => ''two'', :action => ''x''}) This isn''t working. Thanks, Ram. -- 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 -~----------~----~----~----~------~----~------~--~---
Hi Ram, Ram wrote:> What I have now is in a view of controller ''one'': > <% link_to_remote("link", :update => ''div'', > :url => {:controller => ''two'', > :action => ''x''}) > > This isn''t working.I notice two potential problems. The first thing I notice is that you''re not rendering the link. That is, <% link... needs to be <%= link... The second thing is that you''ve named the DOM element with what I believe is a reserved word in HTML. (i.e., ''div'') If changing these doesn''t produce what you expect, we''ll need more info to help. The link_to_remote method your using does two things and we need to know which one you''re having problems with. 1) it invokes a method in a controller as specified in your url hash. (it also allows for passing values from the browser via the params hash) 2) it produces the response the browser will use to update DOM element you specify in the :update option. To isolate the problem, in your controller method you should do something ''extra'' that will leave evidence that the method was triggered. Write a record to the database or something like that that you can see. Also, use Firebug to see the request / response and inspect the DOM. hth, Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> The second thing is that you''ve named the DOM element with what I > believe is > a reserved word in HTML. (i.e., ''div'')I put this html, saved as "div.html" through the http://validator.w3.org validator; and it''s valid: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <script src="prototype.js" type="text/javascript"></script> <title>div</title> </head> <body> <div id="div" onclick="$(''div'').innerHTML = ''div updated''"> div </div> </body> </html> Works too! Stephan -- 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 -~----------~----~----~----~------~----~------~--~---