How to get updated value from a database and show it on the page using ajax
问题 I have a rails form that imports remotely some products from a google spreadsheet. While doing so, it updates company that makes those products by setting its company.import_status to "started", when the importing starts, and "finish", once it's done. I have a page that shows company.import_status, and I try to update it so I can see when an import starts and when it's finished. My code looks like this: $(document).ready(function(){ <% @companies.each do |company| %> setInterval(function