芽核和Rails:sproutcore 应用程序位于rails 中的什么位置?目录结构?
我有一个可用的 Rails 3 应用程序服务,普通的旧 HTML CRUD,我想为其构建一个 sproutcore 客户端。我(认为)我了解 Rails 和 Sproutcore,但我有一个令人尴尬且愚蠢的新手问题:
我应该将 sproutcore 应用程序放在 Rails 项目结构中的什么位置?
具体来说,考虑到我:
myapp/
app/
...
public/
...
并且我需要说:
sc-init SOMETHING
那会是什么? (myapp?公共?) sproutcore 应用程序 html 从哪里来? 提供该服务的最佳实践是什么(路线?) sc-server 到底能做什么而我用 WebBrick/Mongrel 等无法做到的?
非常感谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
sproutcore todos 教程最后有一个部分,其中将应用程序插入多个“后端”,包括 Rails3。 Rails3 位在这里: http://wiki.sproutcore .com/w/page/Todos+06-Building+with+Rails+3
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
我还没有部署构建的 SproutCore 应用程序,所以我无法回答文件应该位于 Rails 站点结构中的位置(但我猜测在
public/
中,因为您本质上是在提供 HTML以及大量 Javascript 作为静态资产)。sc-server
允许您在开发应用程序时在本地主机中运行应用程序,因此您不必每次使用您的应用程序进行调整时都执行sc-build
应用。请记住,它是sc-build
的输出,它将成为生产站点;您不会使用sc-server
为该网站提供服务(您也不想这样做)。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 dosc-build
every time you tweak something with your application. Remember that it's the output ofsc-build
which will be the production site; you won't be serving the site withsc-server
(nor would you want to).