Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Sproutcore 2.0 on Rails 3.1 (or: Don't get stuck in the asset pipeline...)
Ruby JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db
doc
lib/tasks
log
public
script
vendor
.gitignore
Gemfile
Gemfile.lock
README
Rakefile
config.ru

README

== Sproutcore 2.0 on Rails 3.1 ==
Or: Don't get stuck in the asset pipeline

I've borrowed heavily from:
http://guides.sproutcore20.com/getting_started.html
https://github.com/ebastien/sproutcore-with-rails

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.