Edit product


Backbone.js on Rails

Build snappier, more interactive apps with cleaner code and better tests in no time

You build web apps, and you’ve seen the shift towards highly interactive, rich client-side web applications. Over the past years, we’ve seen the same things, and have built our apps, processes, and best practices around this. Learn the better way to build rich, interactive applications using Backbone.js and Rails.

Download a free sample chapter.

More than just a book

In addition to the book (in HTML, PDF, EPUB, and Kindle formats), you also get a complete example application.

The book is written using Markdown and distributed via GitHub. When you purchase, we give you access directly to the repository, so you can use the GitHub comment and issue features to give us feedback about what we’ve written and what you’d like to see. Last but not least, also included is a complete sample Backbone.js and Rails application. What the book describes and explains, the example app demonstrates with real, working code. Fully up to date for Rails 3.2 and Backbone 1.0.

Table of Contents


  • Why use Backbone.js
  • The Example Application

Getting up to speed

  • Backbone.js online resources
  • JavaScript online resources and books


  • Backbone.js and MVC
  • What Goes Where
  • Namespacing your application
  • Mixins

Rails Integration

  • Organizing your Backbone.js code in a Rails app
  • Rails 3.0 and prior
  • Rails 3.1 and above
  • An Overview of the Stack: Connecting Rails and Backbone.js
  • Customizing your Rails-generated JSON
  • Converting an existing page/view area to use Backbone.js
  • Automatically using the Rails authentication token

Routers, Views, and Templates

  • View explanation
  • Templating strategy
  • Choosing a strategy (stub)
  • Routers
  • Event binding
  • Cleaning Up: Unbinding
  • Swapping router
  • Composite views
  • Forms
  • Internationalization

Models and collections

  • Model associations
  • Filters and sorting
  • Validations
  • Model relationships
  • Duplicating business logic across the client and server
  • Synchronizing between clients
  • Uploading attachments


  • Full-stack integration testing
  • Isolated unit testing
  • Example: Test-driving a Task application


  • XSS with JSON bootstrapping

The included example application illustrates a Rails 3.2 app with user authentication, nested model relationships, bootstrapped and lazily populated collections, and complete test coverage using Cucumber, RSpec, and Jasmine.

You've purchased this product

See it in your library

View in Library
Sorry, this item is not available in your location.
Sold out, please go back and pick another option.

Name a fair price:

0 ratings

  • You'll get .pdf, .mobi, .epub, and .html files, plus access to the GitHub repository with the book's source code and an example Rails/Backbone app.
  • PDF Length183 pages


Backbone.js on Rails

Enter your info to complete your purchase


···· ···· ···· 4242
Test card



Use a different card?


pp paypal

or pay with

We do not keep any of your sensitive credit card information on file with us unless you ask us to after this purchase is complete.

or pay with

Your purchase was successful!

We charged your card and sent you a receipt

    Gumroad Library

    Download from the App Store or text yourself a link to the app

    Thank you for your purchase!

    If you’re not happy, just let us know within 30 days and we’ll refund your money. It’s as simple as that.

    Good news! Since you already have a Gumroad account, it's also been added to your library.

    Powered by Gumroad