Answer the question
In order to leave comments, you need to log in
How to repeatedly call a function from application.js?
Good afternoon.
I do the example #240 Search, Sort, Paginate with AJAX - RailsCasts
In order to implement live seach, the following is done there.
#application.js
$(function() {
$("#contracts_search input").keyup(function() {
$.get($("#contracts_search").attr("action"), $("#contracts_search").serialize(), null, "script");
return false;
});
});
Answer the question
In order to leave comments, you need to log in
$(document).on('keyup', '#contracts_search', function() {
// event handler
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question