芽核和Rails:sproutcore 应用程序位于rails 中的什么位置?目录结构?

发布于 2024-09-28 18:37:45 字数 455 浏览 8 评论 0原文

我有一个可用的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

北陌 2024-10-05 18:37:46

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

青巷忧颜 2024-10-05 18:37:46

我还没有部署构建的 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 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文