I have a column hit in my responses table, and I need to create a
button beside every response. And when the button is clicked, the
counter value should be incremented and displayed on the same page.
I created a method in mycontroller,
@response.update_attribute :hit, params[:count] + 1
and in the view
<%= button_to "Click" , response, :action => update_hit %>
I am not sure if I am doing it the right way. What can I do about
And how can i display it in the same page?