I am trying to write a sproutcore frontend for a rails 3.1 application I am making. I have had a look at the sproutcore guides, but I am interested in seeing real examples how to use sproutcore together with rails 3(.1).
I have found two examples, but each is totally different:
- A todo-app created using bulk_api: an interesting approach using a specific REST-style to minimise the traffic. But it proposes to place the sproutcore app in
app/sproutcore
, and is still a bit unclear to me how that actually hooks in completely. - Travis-ci which seems to be a very clean example, rails 3.1, to use sproutcore. It is not yet completely clear to me, but all sproutcore js is cleanly stored inside
app/assets/javascript/apps
and as far as i can tell, theapplication.html
just loads the js and provides the frame where everything is loaded into.
Do you know any other examples? How do you use sproutcore in your rails app?
I did find a demo-project: sproutcore-on-rails that did manage to make things clearer for me.
The method you describe is the same way that you integrate backbone.js into a rails app, and it seems to work very well
https://github.com/codebrew/backbone-rails
This stores backbone in
app/assets/javascripts/backbone/
app/assets/javascripts/backbone/app/models
app/assets/javascripts/backbone/app/controllers
And then there is a script tag in the view that just initializes backbone
I imagine a similar process for sproutcore would make sense