将 Google Gears 与 Rails 结合使用
我的任务是探索离线访问我的网络应用程序的可能性。 人们使用 google gears 和 Rails 的体验如何? 我知道 gearsonrails 项目,但它有一些非常奇怪的结构,而且似乎并不重要,积极发展。
还有其他选择吗? 有人成功地将齿轮添加到现有的 Rails 应用程序中吗? 这是超级痛苦吗?
I have been tasked with exploring the possibility of offline access of my webapp. What are people's experiences using google gears with rails? I am aware of the gearsonrails project, but it has some really strange constructs and doesn't appear to be under significant, active development.
Are there other options? Has anyone added gears to their existing rails app successfully? Is this super-painful?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Google Gears 已停止开发,正在开发已经停止了。 您最好尝试使用 HTML5 来解决您的问题,HTML5 实现了使离线访问成为可能的 API(可以使用类似 SQL 的语言和键值存储来查询的客户端数据库)。主要浏览器完全实现(开发中)标准。 因此,您必须做出决定,是针对事实上已过时的插件进行开发,还是针对新兴标准进行开发。
Google Gears is dead, development has ceased. You're better off trying to solve your problem using HTML5, which implements APIs that make offline access possible (a client side database that can be queried using a SQL like language and a key-value store.) At this point, none of the major browsers completely implement the (developing) standard. So you have to make the decision between developing against a de facto obsolete plugin, or targeting an emerging standard.
我自己正在研究这个 - 一般来说,这个想法是,根据你想要离线使用的内容,你需要在客户端进行设置(注意,这是未经测试的,因此未经验证 - 我只是从我的理解出发我已经阅读过 - 尽管我计划在接下来的几周内进行一些实验...)
我建议使用 Rails 设置标准的 Restful 资源,然后在您的客户端库中执行如下操作:
。 -仅作为示例,并依赖于使用 AJAX 客户端调用来填充页面中的数据等的现有架构。
您的方法可能会有所不同,但我建议您尝试一下 - 请记住您没有使用 Rails 插件等来做到这一点 - 你可以自己滚动客户端脚本 - 你永远不知道,一旦你完成了,你可能能够将你的工作重构为一个很棒的小 gem 或类似的东西......
I am looking into this myself - generally the idea is that depending on what you want to make available offline you need to setup on the client side (note, this is untested, and hence unverified - I'm just going from my understanding of what I have read - although I am planning on doing some experimentation in the next few weeks...)
In most situations I would recommend setting up standard restful resources with Rails, and then in your client library do something like the following:
Obviously this is a read-only example, and relies on the existing architecture using AJAX client side calls to populate data in the page etc.
Your means might vary, but I recommend just having a play around - remember you don't have to use Rails plugins etc to do this - you can just roll the client side script by yourself - and you never know, once your done you might be able to refactor your work out into a great little gem or similar...