I have a post model with a number field named applause_counter
in my stimulus controller I can catch and print out the new value to the console log.
app/javascript/controllers/post_controller.js
increment() {
var value = this.applause_counterTarget.value
console.log(value)
this.applause_counterTarget.textContent = value
}
But how can I update the model with the new value, after each click?