I am using link_to tag to change the validity:
<%= link_to "Mark as " + (doc.is_valid ? "invalid" : "valid"),
:action =>'change_validity',:id => doc.id %>
Here, is_valid is a field in a table with boolean value. When it is true link will show as "Mark as invalid". When I click the link it will call the method "change_validity" method in controller. The method will toggle the is_valid field and show "Mark as valid" in view.
This one I want to do using AJAX. I tried to using link_to_remote. But I couldn't get it. Can anyone explain how to do it???