views:

38

answers:

2

I have a working Rails 3 app service plain old HTML CRUD and I want to build a sproutcore client for the same. I (think) I understand Rails and Sproutcore, but I have an embarrassingly silly newbie question:

Where do I put the sproutcore app within the rails project structure?

Specifically, given that I have:

myapp/
    app/
    ...
    public/
    ...

And I need to say:

sc-init SOMETHING

What would the SOMETHING be? (myapp? public?) Where does the sproutcore app html come from? What are the best practices for serving that (routes?) What really does sc-server do that I can't do with WebBrick/Mongrel, etc.?

Thanks so much!

A: 

I haven't deployed a built SproutCore app yet, so I can't answer where the files should live in the Rails site structure (but I'm guessing within public/ because you're essentially serving HTML and a lot of Javascript as static assets).

sc-server lets you run your application in your localhost while you're developing it, so you don't have to do sc-build every time you tweak something with your application. Remember that it's the output of sc-build which will be the production site; you won't be serving the site with sc-server (nor would you want to).

pjmorse
Thanks. I guess I'll need to automate the sc-build step in rake and then make static (globbed?) routes to sc-build's output. Thanks
Eric
A: 

The sproutcore todos tutorial has a section at the end where the plug the app into several "backends" including Rails3. The Rails3 bit is here: http://wiki.sproutcore.com/w/page/Todos+06-Building+with+Rails+3

Ian
Alas, the sproutcore tutorial doesn't actually cover where (in rails) to place the client code - it sort of assumes you'll have a different repo for the client (which many will likely do).
Eric
To clarify: I guess this question comes down to how to get sc-build automation when the client code has changed in a rails app. Sort of like what haml, sass or less do for templates/css compilation.
Eric