Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Sproutcore 2.0 on Rails 3.1 (or: Don't get stuck in the asset pipeline...)

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 config
Octocat-spinner-32 db
Octocat-spinner-32 doc
Octocat-spinner-32 lib
Octocat-spinner-32 log
Octocat-spinner-32 public
Octocat-spinner-32 script
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
== Sproutcore 2.0 on Rails 3.1 ==
Or: Don't get stuck in the asset pipeline

I've borrowed heavily from:

1. Create your stock standard Rails 3.1 application, it includes jQuery, which Sproutcore 2.0 requires.
2. Include the sproutcore-rails gem in the Gemfile, this will give us access to the sproutcore 2.0 js file, and ebastien's handy handlebars translator for sprockets.
3. Get a basic controller & view going, remove public/index.html
4. Tweak application.js slightly, we don't want to include our todos application on every page, so remove the tree include, and make our own todos.js manifest instead.
5. Toss our todos.js manifest in the application layout header for now
6. Do steps 1-6 in the Sproutcore 2.0 guide, using app/assets/javascripts/todos/app.js
7. Since we've got our own manifest for todos, add the app.js to the todos.js file, sprockets automatically includes it after sproutcore
8. We can toss the todos css into our app/assets/styles folder for now
9. Add our handlebars template app/assets/javascripts/todos/templates/todos.js.hjs in our todos.js manifest and add the Todos title to our app/views/pages/index.html.erb view
10. Tell sproutcore to append our handlebars template onto the end of our view
11. Make things work by linking template & application with CreateTodoView, from the Sproutcore guide
12. Finish up the rest of the spiffy todos application from Sproutcore Guide
Something went wrong with that request. Please try again.