Hellow, I have such problem. So I have usual .js.erb template, which is called from controller with format.js This template is just for testing now, so only calls alert message, if some links are clicked. I didn''t modified default layout document. The problem is that on first click nothing happens, than it alerts as many times, as all links was clicked until this moment. So 1st time click - zero alerts, 2 time click - 1 alert, 3 time click - 2 alerts and so on. The code of Jquery file is so simple, that definetely not the source of problem. May be some ideas? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/co0W2k8GFE4J. For more options, visit https://groups.google.com/groups/opt_out.
On 12 March 2013 22:50, Barry <burmanz-JGs/UdohzUI@public.gmane.org> wrote:> Hellow, I have such problem. So I have usual .js.erb template, which is > called from controller with format.js > This template is just for testing now, so only calls alert message, if some > links are clicked. I didn''t modified default layout document. > The problem is that on first click nothing happens, than it alerts as many > times, as all links was clicked until this moment. > So 1st time click - zero alerts, 2 time click - 1 alert, 3 time click - 2 > alerts and so on. > The code of Jquery file is so simple, that definetely not the source of > problem.Well since the rest of the code is so simple it can''t be that either, I assume. The obvious conclusion is that it is working correctly. Have a look at the rails guide on debugging which will give you techniques that you can use to debug the code. The first thing to do is to work out where it is failing so you can look in the log to see what actions are being called at what points and you can debug the data you are passing up to the view to see if that is ok. Once you have worked out which bit of code is failing you will probably see the problem, if not then come back and show us the code that is failing (not the whole app, just the bit that is failing). Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Colin Law wrote in post #1101662:> Well since the rest of the code is so simple it can''t be that either, > I assume. The obvious conclusion is that it is working correctly. > > Have a look at the rails guide on debugging which will give you > techniques that you can use to debug the code. The first thing to do > is to work out where it is failing so you can look in the log to see > what actions are being called at what points and you can debug the > data you are passing up to the view to see if that is ok. > > Once you have worked out which bit of code is failing you will > probably see the problem, if not then come back and show us the code > that is failing (not the whole app, just the bit that is failing). > > Colin@Colin, FYI: I''m pretty sure this is a duplicate of another thread, which has been resolved. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 14 March 2013 19:55, Robert Walker <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote in post #1101662: >> Well since the rest of the code is so simple it can''t be that either, >> I assume. The obvious conclusion is that it is working correctly. >> >> Have a look at the rails guide on debugging which will give you >> techniques that you can use to debug the code. The first thing to do >> is to work out where it is failing so you can look in the log to see >> what actions are being called at what points and you can debug the >> data you are passing up to the view to see if that is ok. >> >> Once you have worked out which bit of code is failing you will >> probably see the problem, if not then come back and show us the code >> that is failing (not the whole app, just the bit that is failing). >> >> Colin > > @Colin, FYI: I''m pretty sure this is a duplicate of another thread, > which has been resolved.OK, thanks. I must have missed it. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.