I have a lot of problems trying to do something that, in my opinion, would be fairly simple.
I have a list of items, say todos. At the bottom of this list, I have a text box where I add new items to this list. I want to make sure that new elements are added to the bottom of this list dynamically, without a full page refresh, for example, in the chat window.
I made a submit form remote: trueand successfully submitted it without reloading the page, but I can’t get a new item that will be displayed at the bottom of the list at the same time. I need to refresh the page to see the changes.
I tried several different approaches that I found on SO (there is no dearth of similar issues), as well as on the Internet and even in the Sync stone, but each of them had errors and problems, and I could not get any for the correct operation. Each of them may be his own question. So instead, I ask: is there a “recipe” that will definitely implement this in Rails 4?
source
share