简体   繁体   English

PhoneGap和rails 3:如何与rails 3 app进行交互

[英]PhoneGap and rails 3: How to interact with a rails 3 app

totally PhoneGap newbie here, but looking to learn the basics of how to interact with a Rails 3 web app using Phonegap. 这里完全是PhoneGap新手,但希望了解如何使用Phonegap与Rails 3网络应用程序进行交互的基础知识。

I'm looking to release a lightweight version of my Rails 3 web app as an iOS app in the appstore. 我希望在appstore中发布我的Rails 3 Web应用程序的轻量级版本作为iOS应用程序。 I understand how PhoneGap uses CSS/HTML/JS to work but how do I tie in my Rails 3 app functionality/ruby code. 我理解PhoneGap如何使用CSS / HTML / JS工作,但我如何配合我的Rails 3 app功能/ ruby​​代码。 Thanks a lot for any insights. 非常感谢您的任何见解。

Your production rails app will live at some domain. 您的生产轨道应用程序将存在于某个域。 Specify a manifest of css, js and templates to be cached locally and distributed with your app. 指定要在本地缓存并随应用程序分发的css,js和模板的清单。 Point your XHRs at your production rails app to fetch data and render everything locally with something like mustache . 将XHR指向生产轨道应用程序以获取数据并使用胡子之类的东西在本地渲染所有内容。

A client-side MVC framework like Backbone is useful in this situation. Backbone这样的客户端MVC框架在这种情况下很有用。

Read PhoneGap's Get Started Guide . 阅读PhoneGap的入门指南

I'm currently working on a phonegap app integrating with .net. 我目前正在开发一个与.net集成的phonegap应用程序。 I do all of my interaction with my .net webservice by using xui's xhr call that return/submit either json or xml data. 我通过使用返回/提交json或xml数据的xui xhr调用来完成与.net webservice的所有交互。

Refer to the following link to read more on xui and xhr http://xuijs.com/docs/xhr 请参阅以下链接以了解有关xui和xhr http://xuijs.com/docs/xhr的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM