Add the following to your Gemfile:
gem "backbonejs-rails", "~> 0.0.5"
Then use Bundler to install:
$ bundle install
$ rails g backbonejs:install
Optionally you can add -ich to the end of that command to have icanhaz.js included.
What Does it do?
/backone /models /routers /views
//= require underscore
after this line:
//= require jquery
For templates I have included ICanHaz.js which you can optionally include by doing the following
$ rails g backbonejs:install -ich
It also creates a file called "config/initializers/backbone.rb" which contains the line:
ActiveRecord::Base.include_root_in_json = false
Which is what you need to return JSON to Backbone the way it likes it. Otherwise you would need to do something like this:
def create render :json => Person.create(:name => params[:name], :age => params[:age]) end
You can find my screencast on Backbone.js and Rails 3 here