I am trying to add a like button to a post in my RoR application. The two models I have are Post and Like.
On my webpage I am going to put the like button right next to the post button, but when users click the like button, I would like to have th request run in the background and not have to refresh the page.
Does anyone know of a simple way I could do this or where I can learn more about how to do it?
I am using the jQuery JavaScript library in my Rails application.
You can use jquery’s ajax
api here
http://api.jquery.com/jQuery.ajax/
or even this one
http://jqapi.com/#p=jQuery.ajax