声明:JavaEye新闻文章的版权属于JavaEye网站所有,严禁任何网站转载本文,否则必将追究法律责任!
安装插件: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数据将自动与远程进行同步。

然后在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 条 发表评论