3 ms·
This reminds me a lot of rails-ujs. I built a jquery-based alternative to intercooler (didn't know it existed) back in the day that used the rails-ujs events to
by mosselman 6y ago
This reminds me a lot of rails-ujs. I built a jquery-based alternative to intercooler (didn't know it existed) back in the day that used the rails-ujs events to do its thing.
A few days ago, instead of going this route, I just used a `.js` view in Rails to replace the necessary elements in the DOM. This is even easier than having to load something like kutty and specifying in attributes what it needs to do:
Taken from the Rails guides:
$("<%= escape_javascript(render @user) %>").appendTo("#users");
This uses jQuery, but you can all imagine how to do this with vanilla js and it works so well.