<div>
                    I've found <a href="http://knockoutjs.com/documentation/introduction.html">Knockout.js</a> to be a great just-the-bindings-please library, as long as you're fine with its <font face="Courier New"><span data-bind="text: variableName"/></font> style. It strikes me that it'd make a good fit for a mostly server-side app: populate your HTML with data *and* binding attributes, and then hijack it with Knockout as and when you need to update stuff.
                </div><div><br></div><div>I'm an advocate of putting your JS in modules and explicitly importing them, but I don't know what the current best tool for that is. <a href="http://browserify.org/">browserify</a>, <a href="http://requirejs.org/">require.js</a> and Square's <a href="http://square.github.io/es6-module-transpiler/">ES6 module transpiler</a> are all relevant.</div><div><br></div><div><br></div>
                <div></div>
                 
                <p style="color: #A0A0A8;">On Wednesday, 17 July 2013 at 13:13, Tim Cowlishaw wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div>Hi all,</div><div><br></div><div>I've just finished working on the first rails app I've started from</div><div>scratch in ages, and, took the opportunity to apply some of the ideas</div><div>from Matt Wynne's Hexagonal Rails talk and Avdi Grimm's Objects on</div><div>Rails book, in the process.</div><div><br></div><div>I've been really happy with the result - I've been able to make</div><div>changes with more confidence, and ship new features faster than I have</div><div>taking  a more rails-y approach to application architecture, and my</div><div>test coverage is vastly better.</div><div><br></div><div>Whoever, there's a rather nasty skeleton in the</div><div>"app/assets/javascript" closet in my app, as, while I'm aware of the</div><div>proliferation of javascript testing frameworks and tools, and</div><div>libraries for doing client-side models, data-binding, etc, I'm really</div><div>not sure how best to structure my javascript code in order to take</div><div>advantage of them (apart from throwing out the idea of server</div><div>generated views entirely, and writing a thick-client js app which</div><div>talks to an API, which I'm not keen on, as I'm a boring old</div><div>stick-in-the-mud who likes things on the web to have proper URLs)</div><div><br></div><div>Therefore, has anyone got any tips or tricks for writing maintainable,</div><div>testable, well-factored javascript as part of a rails application</div><div>which has reasonably complex client-side behaviour, but isn't a</div><div>one-page app? Links to talks / blogposts / example codebases also</div><div>gratefully appreciated!</div><div><br></div><div>Cheers,</div><div><br></div><div>Tim</div><div>_______________________________________________</div><div>Chat mailing list</div><div><a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a></div><div><a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a></div></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>