I wrote a small wrapper on top of backbone and Backbone.Rails.js [1]. The combo replaced a very bulky internal framework, and I would never go back.<p>[1] <a href="https://gist.github.com/719080" rel="nofollow">https://gist.github.com/719080</a>
Before I started developing Rails I always used JSON + client side templates which were constructed in pure jQuery and really tedious.<p>Then, with Rails, I asked myself, why would I want to have the template somewhere in the middle of a JS file where it isn't even recognizable as an HTML template at first sight? Why not have it, like all the other views, in one convenient place? Furthermore, often you have a partial you render on the server side and with some AJAX you send more entities of this partial to the client. Having this partial twice is really tedious if you wan't to tweak the HTML.
Could anyone share some good tutorials or guides on getting started with (preferably jQuery) AJAX and Rails 3?<p>I'm doing a little here and there in a current web app, but I could absolutely use some tips, pointers, and direction on better ways.
Is anyone using pure.js? That's been one on my radar since they use pure HTML templates with JSON models. I don't think it does data binding to update the template automatically after the first render if the model changes, but apart from that, it seems preferable to using custom templates like jQuery or Mustache etc.<p><a href="http://beebole.com/pure/" rel="nofollow">http://beebole.com/pure/</a><p>That having been said, I haven't started using it yet. I'm open to other viewpoints.
I like to use a combination of these. There is no wrong way or right way, just the way that gets you done fast, and maintainable. You may begin using one way and find it may be easier trying another way, depending on what you're trying to do. The great thing is the flexibility.