On 12 March 2013 22:50, Barry <[email protected]> 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 [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

