I am using form_remote_tag as follows: <%= form_remote_tag(:update => "sku", :url=>{:action =>:generate_skus}) %> The problem I am having is the web page will actually change to the generate_skus page which defeats the purpose of using this. Any ideas on why it wouldnt update the html code on the current page. -- 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 -~----------~----~----~----~------~----~------~--~---
Pat wrote:> I am using form_remote_tag as follows: > <%= form_remote_tag(:update => "sku", :url=>{:action =>:generate_skus}) > %> > The problem I am having is the web page will actually change to the > generate_skus page which defeats the purpose of using this. Any ideas on > why it wouldnt update the html code on the current page.Post the code that responds to that action. -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Phlip wrote:> Pat wrote: > >> I am using form_remote_tag as follows: >> <%= form_remote_tag(:update => "sku", :url=>{:action =>:generate_skus}) >> %> >> The problem I am having is the web page will actually change to the >> generate_skus page which defeats the purpose of using this. Any ideas on >> why it wouldnt update the html code on the current page. > > Post the code that responds to that action. > > -- > Phlip > http://www.oreilly.com/catalog/9780596510657/ > "Test Driven Ajax (on Rails)" > assert_xpath, assert_javascript, & assert_ajaxcontroller def generate_skus @output = "This is not correct" render :partial => "generate_skus" end view for _generate_skus <%= @output %> -- 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 -~----------~----~----~----~------~----~------~--~---
>> Pat wrote: >> >>> I am using form_remote_tag as follows: >>> <%= form_remote_tag(:update => "sku", :url=>{:action =>:generate_skus}) >>> %>I can''t help because I just never use :update. I know it''s useful...> def generate_skus > @output = "This is not correct" > render :partial => "generate_skus" > end > view for _generate_skus > <%= @output %>I''m also aware that some people don''t like to mix model and view code. But I would have written the response like this: render :update do |page| page.replace_html ''sku'', @output end -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ 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 -- On Fri, 6 Jul 2007, Pat wrote:> > I am using form_remote_tag as follows: > <%= form_remote_tag(:update => "sku", :url=>{:action =>:generate_skus}) > %> > The problem I am having is the web page will actually change to the > generate_skus page which defeats the purpose of using this. Any ideas on > why it wouldnt update the html code on the current page.Are you sure you''re loading the necessary JavaScript files? It sounds like maybe it''s falling back on doing a non-Ajax request to your action. David -- * Books: RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.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 -~----------~----~----~----~------~----~------~--~---
unknown wrote:> Hi -- > > On Fri, 6 Jul 2007, Pat wrote: > >> >> I am using form_remote_tag as follows: >> <%= form_remote_tag(:update => "sku", :url=>{:action =>:generate_skus}) >> %> >> The problem I am having is the web page will actually change to the >> generate_skus page which defeats the purpose of using this. Any ideas on >> why it wouldnt update the html code on the current page. > > Are you sure you''re loading the necessary JavaScript files? It sounds > like maybe it''s falling back on doing a non-Ajax request to your > action. > > > David > > -- > * Books: > RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) > RUBY FOR RAILS (http://www.manning.com/black) > * Ruby/Rails training > & consulting: Ruby Power and Light, LLC (http://www.rubypal.com)I have used <%= javascript_include_tag :defaults %> which generates the following javascript <script src="/javascripts/prototype.js" type="text/javascript"></script> <script src="/javascripts/effects.js" type="text/javascript"></script> <script src="/javascripts/dragdrop.js" type="text/javascript"></script> <script src="/javascripts/controls.js" type="text/javascript"></script> -- 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 -~----------~----~----~----~------~----~------~--~---
If I understand what you''re saying - your generate_skus partial is being rendered as a seperate page? Is your generate_skus partial page named correctly? It''s been a little while since I fooled with a partial, and I don''t have my environment here with me, but I think skus are named like "_generate_skus.rhtml" - do you maybe have a file named "generate_skus.rhtml"? Or do you have both _generate_skus.rhtml and generate_skus.rhtml in the same folder? Though I wouldn''t think that would be a problem. Sorry if I''m mucking this up with the wrong syntax! :D On 7/5/07, Pat <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > unknown wrote: > > Hi -- > > > > On Fri, 6 Jul 2007, Pat wrote: > > > >> > >> I am using form_remote_tag as follows: > >> <%= form_remote_tag(:update => "sku", :url=>{:action =>:generate_skus}) > >> %> > >> The problem I am having is the web page will actually change to the > >> generate_skus page which defeats the purpose of using this. Any ideas > on > >> why it wouldnt update the html code on the current page. > > > > Are you sure you''re loading the necessary JavaScript files? It sounds > > like maybe it''s falling back on doing a non-Ajax request to your > > action. > > > > > > David > > > > -- > > * Books: > > RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) > > RUBY FOR RAILS (http://www.manning.com/black) > > * Ruby/Rails training > > & consulting: Ruby Power and Light, LLC (http://www.rubypal.com) > > I have used > <%= javascript_include_tag :defaults %> > which generates the following javascript > <script src="/javascripts/prototype.js" type="text/javascript"></script> > <script src="/javascripts/effects.js" type="text/javascript"></script> > <script src="/javascripts/dragdrop.js" type="text/javascript"></script> > <script src="/javascripts/controls.js" type="text/javascript"></script> > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Terry (TAD) Donaghe http://tadspot.tumblr.com http://www.rubynoob.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 have the _generate_skus.rhtml in the views folder for the controller that calls it and there is not a generate_skus.rhtml. -- 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 -~----------~----~----~----~------~----~------~--~---