I''m working through Agile Web Dev. On page 130, you change an add to cart button that posts to a new page to a button that does an Ajax post. The code changes from button_to to form_remote_tag with arguments. But when I use that tag nothing appears on the page. (And there''s nothing in the source. Rails just ignores the tag entirely.) <% form_remote_tag :url => { :action => :add_to_cart, :id => product } do %> <%= submit_tag "Add to Cart" %> <% end %> I''ve swapped my code for the code downloaded from the book, but still nothing. First, am I missing something? Second, how does one trouble-shoot these kinds of problems? View source gives me nada and rails tells me nothing. Where do I look to troubleshoot? Thanks, -- Austin Govella Thinking & Making: IA, UX, and IxD http://thinkingandmaking.com austin.govella-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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?hl=en -~----------~----~----~----~------~----~------~--~---
> First, am I missing something?Yes. Your ''<% form_remote_tag'' should be ''<%= form_remote_tag''.> Second, how does one trouble-shoot > these kinds of problems? View source gives me nada and rails tells me > nothing. Where do I look to troubleshoot?Content not even appearing may well be something you''re going to have to debug for yourself. If you''re anything like me, a few times of leaving off the = sign as you have done here, and you''ll soon learn how to diagnose this particular problem! :) If you''re doing anything with Ajax and RJS, I can''t recommend the FireBug extension for Firefox enough. It''s a real godsend. Scott --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Nov 7, 2006, at 11:37 AM, Austin Govella wrote:> I''m working through Agile Web Dev. On page 130, you change an add to > cart button that posts to a new page to a button that does an Ajax > post. The code changes from button_to to form_remote_tag with > arguments. > > But when I use that tag nothing appears on the page. (And there''s > nothing in the source. Rails just ignores the tag entirely.) > > <% form_remote_tag :url => { :action => :add_to_cart, :id => > product } do %> > <%= submit_tag "Add to Cart" %> > <% end %> > > I''ve swapped my code for the code downloaded from the book, but > still nothing. > > First, am I missing something? Second, how does one trouble-shoot > these kinds of problems? View source gives me nada and rails tells me > nothing. Where do I look to troubleshoot?You need Edge Rails to use the new-style form_tag and form_remote_tag helpers. If you''d rather not install via Subversion, I''ve prepared a zip file of today''s Edge rails. Download http://media.pragprog.com/titles/rails2/code.rails.zip into your application''s vendor/ directory, and then unzip it. Then go back to your applications main directory and type rake rails:update If you restart your application, all the new stuff should work. DON''T USE THIS IN PRODUCTION. NO WARRANTIES. ETC. Dave --~--~---------~--~----~------------~-------~--~----~ 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 updated to the most recent version of rails and that fixed it. (Though, I thought I was already on a recent enough edge.) And I guess that answers a troubl-shooting question: verify the feature you''re using against the rails version you''re using. Thanks, -- Austin On 11/7/06, Dave Thomas <dave-kbbdpT5sCmpWk0Htik3J/w@public.gmane.org> wrote:> > > On Nov 7, 2006, at 11:37 AM, Austin Govella wrote: > > > I''m working through Agile Web Dev. On page 130, you change an add to > > cart button that posts to a new page to a button that does an Ajax > > post. The code changes from button_to to form_remote_tag with > > arguments. > > > > But when I use that tag nothing appears on the page. (And there''s > > nothing in the source. Rails just ignores the tag entirely.) > > > > <% form_remote_tag :url => { :action => :add_to_cart, :id => > > product } do %> > > <%= submit_tag "Add to Cart" %> > > <% end %> > > > > I''ve swapped my code for the code downloaded from the book, but > > still nothing. > > > > First, am I missing something? Second, how does one trouble-shoot > > these kinds of problems? View source gives me nada and rails tells me > > nothing. Where do I look to troubleshoot? > > You need Edge Rails to use the new-style form_tag and form_remote_tag > helpers. > > If you''d rather not install via Subversion, I''ve prepared a zip file > of today''s Edge rails. Download > > http://media.pragprog.com/titles/rails2/code.rails.zip > > into your application''s vendor/ directory, and then unzip it. Then go > back to your applications main directory and type > > rake rails:update > > If you restart your application, all the new stuff should work. > > DON''T USE THIS IN PRODUCTION. NO WARRANTIES. ETC. > > > > Dave > > > >-- Austin Govella Thinking & Making: IA, UX, and IxD http://thinkingandmaking.com austin.govella-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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?hl=en -~----------~----~----~----~------~----~------~--~---