Total Pageviews

Tuesday 21 June 2016

Phonegap::Rails

Export a rails single page app as a Phonegap project.
Dependency Status
This gem provides generators for the Phonegap APIs. It is intended to be used within the scope of single page web applications that have a Ruby on Rails API backend. For example, Ember.js / Rails apps.
This gem will export assets included in the rails project as a Phonegap project. This gem won't be able to export applications where content is generated dynamically by the server (e.g applications making use of eRuby).

Installation

Add this line to your application's Gemfile:
gem 'phonegap-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install phonegap-rails
Initialize:
$ rails g phonegap_rails:install
Edit your config file according to your environment:
config/phonegap_rails.yml

Usage

Create android project

$ rake phonegap:rails:android:create
Perform all steps to create android project and run (connect phone via USB if you want to install on your terminal)
    $ rake phonegap:rails:android:initall

Other useful tasks

Export application application assets to the android Phonegap project
$ rake phonegap:rails:android:export
Build project
$ rake phonegap:rails:android:build
Launch emulator
$ rake phonegap:rails:android:emulate
Clean
$ rake phonegap:rails:android:clean
Log
$ rake phonegap:rails:android:log

Requirements

Export ios project

Xcode must be installed
TODO: This section is still pending implementation
$ rake Phonegap:rails:iOS:export
from https://github.com/joscas/phonegap-rails