To correspond to this, I have increment.js.erb with the following:
Now, when button is clisked, I want to replace the related number and the +1 button with some message like "Incremented".
The problem here is, using static IDs doesn't work for very obvious reason.And the same goes for class.
One very good idea is to generate dynamic IDs, e.g.,
But, how to make this dynamic ID available to the js.erb?