3 ms·
Exactly. Rewriting views is something I really don't want to do. Example: I'm building pages server side and using AJAX PATCHs to update data on the server. The
by pmontra 12y ago
Exactly. Rewriting views is something I really don't want to do. Example: I'm building pages server side and using AJAX PATCHs to update data on the server. The server responds in JSON with a html attribute contaning the very same HTML Rails partial used to create the page. This spares me from having to build a SPA (which for many reasons is not OK in this project) or two different views, one Ruby and one *.js which would be unbearable (as you wrote).
I looked at intercooler supeficially with the hope it could be a foundation to standardize my AJAX calls (I did something myself but it still fluid). I'm not sure I like the way it puts so much information in the attributes of the DOM elements actions are bound to, but I'll keep reading. I prefer doing those stuff all in JavaScript and minimize the impact of frameworks on the DOM. It's still no time to commit to any of them. Let's wait until the dust settles.
- carsongross 12y agoSomeone just posted to the intercooler list about implementing a feature where the intercooler attributes could be specified separately in javascript: https://groups.google.com/forum/#!topic/intercooler-js/FyPBoX_pW0w https://groups.google.com/forum/#!topic/intercooler-js/FyPBo... You might want to jump in on the thread and we'll see if we can coordinate a syntax you find amenable to your style of programming.