Rails 3 离线 Web 应用程序存储和同步

发布于 2025-01-06 19:40:25 字数 288 浏览 2 评论 0原文

我想使用 Rails 3 开发移动应用程序,这些应用程序能够离线工作并在网络可用时立即同步。

我发现 lawnchair 似乎有希望用于存储/同步,因为它是纯 json。

有没有一种方法或设计模式可以在 Rails 3 应用程序离线时激活 Lawnchair,然后在 Rails 3 应用程序再次上线后将其同步到 Lawnchair 数据?

可以使用机架离线来触发此行为吗?

I'd like to use rails 3 to develop mobile apps that will be able to work offline and sync back as soon as the network is available.

I found lawnchair which seems promising for storing/syncing because it is pure json.

Is there a way or design pattern with which I can activate Lawnchair if rails 3 app is offline and then sync lawnchair data back with rails 3 app once it is online again?

Can rack-offline be used to trigger this behaviour?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

梦毁影碎の 2025-01-13 19:40:25

这就是我现在正在做的事情:

  1. 我将使用 Rails 3 应用程序作为 JSON API
  2. 前端将由 Backbone.js 管理,我发现它“很好”,这对我来说意味着当我第一次拥有一个有机会看看它是如何工作的,它给了我和 Rails 一样的好印象
  3. 存储部分将由 HTML5 localStorage 保存,然后通过 JSON 与 Rails API 同步回(离线时)

我对所有这些的培训内容如下:

  1. <一href="http://peepcode.com/products/html5-browser-caching" rel="nofollow">HTML5 客户端缓存
  2. Backbone.Js on Rails

让我知道不同的选项/路径

This is what I'm doing right now:

  1. I'll use the Rails 3 app as a JSON API
  2. The front end will be managed by Backbone.js which I find to be "good" which to me means that when I first had a chance to look at how it worked it gave me the same good impression as Rails did
  3. The storage part will be held by HTML5 localStorage and then synced back through JSON with the Rails API (when offline)

My training stuff for all this are as follows:

  1. HTML5 Client Side Caching
  2. Backbone.Js on Rails

Let me know different options/paths

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