Just wondering if some one could give me some direction on this..
Standard HTML(erb) view
View is rendered with a form and a table displayed below.
Using Respond to Js in controller updating DOM of view with Jquery. After the form is submitted with remote.
But on the second click it does not fire.
1) On submit of form I do it :remote.. My extra JS fires along with the form and I am happy.
2) Controller responds to JS and I update the form button and the table inplace with JS file via Jquery and two partials. All HTML is exact and good in the JS and partials.
3) Now my button got updated in-place and my table did also and looks good. Now on second click of submit button the extra JS(thats in the applicaiton.js) does not fire. Form still submits and works and table gets updated and everything looks good besides.
4) The only way to get the extra JS to fire again is to add it to the partial that updates the button.
Is this correct ? or should I still be able to fire on the JS in application.js Not sure if I am doing this correctly.. Having the code in two places does not seem right to me.