您的位置: 新闻频道 Ruby新闻

原创新闻 Gears on Rails - 让你的Rails App 离线工作

2008-07-15 by 见习记者 gemstone
评论(0) 有865人浏览 google gears, rails
安装插件:ruby script /plugin install http://gearsonrails.googlecode.com/svn/trunk/acts_as_local



然后在Controller里即可这样来与本地Gears进行离线交互
def create_local
post = Post.build(params("post"));
Post.create_local(post);
window.location.reload( false );
end

--
原理:使用该插件不需要直接通过Gears JavaScript APIs 与Gears对Gears进行操作;而是基于Jester,生成类Rails风格的 REST Javascript来操纵Google Gears。另外,当app online后,本地Gears数据将自动与远程进行同步。



来自:http://google-code-updates.blogspot.com/2008/07/take-your-rails-application-offline.html

评论 共 0 条 发表评论

发表评论

您还没有登录,请登录后发表评论