I don’t do a whole lot of ajaxy/javascript things in rails, so when I make javascript templates I typically just do something like this:
$("element").append("<h2><div id='tester'>Hoorah!</div></h2>");
That’s all fine, so long as the html required is relatively short; if it’s much bigger than a tag or two the solution gets ugly pretty quickly.
So simple question, really: how do folks who use a lot of ajax in rails clean up their script?
there are two popular JS libraries for that, knockout.js and backbone.js. These used to build interactive user interfaces with a clean code. knockout is more easy to learn so i will go for it.