News for hackers. Stuff that matters.
Re:CloudEdit: A Backbone.js Tutorial with Rails by jashkenas on Tuesday February 01, 2011 @10:15AM (#2165738)
Fantastic tutorial -- thanks for taking the time to put it together.

There's a couple things that might be better handled differently:

* Use a collection to keep track of "Documents". You wouldn't have to implement url() yourself, write the manual getJSON() request, or map the response into Document models.

* As previously mentioned, templates would help avoid a lot of the messy string concatenation here.

* You can use the "change" event to listen to changes on documents, instead of re-rendering the Index every time ... That said, with so many people editing the list of docs simultaneously, it probably makes sense to refresh the Index from scratch.

* You shouldn't have to call "delegateEvents()" again inside of Edit#save, as long as the Edit view's "el" hasn't changed.

Great work -- I really appreciate you taking the time to write such a detailed tutorial.

There are no comments on this comment yet.