Can we use Ruby on Rails to develop a mobile app?

Absolutly YES!

Ruby on Rails just a backend tech, is the same as what you plan to do for normal browser. There are only two things that you need to consider about mobile app. First is mobile browser's content size because you need to adjust your layout to fit the size. There is a HTML meta tag called viewport can help you.

Ex.

This script will tell user's browser that the content should be fit the devise size,initial-scale defines the viewport rate and maximum-scale defines how many times this page can scale, and user-scalble=0 means user cannot scale the page. More about viewport you can check the Mozilla's doc.

The other thing you need to consider is the HTML5 techs, but actually these aren't problems when you are using jQuery mobile. I recommend you to check their docs. This is very useful and clear for anyone.


I've created an example rails / ember.js App that is exported with Phonegap. It uses just the usual MVC architecture of a Rails and an Ember.js App. Maybe you will find it useful. It also implements token authentication based on ember-auth and several OAuth strategies.

Currently in de the devel branch: https://github.com/joscas/base_app/tree/devel

Heroku deploy: https://starter-app-staging.herokuapp.com (the desktop version)

Exported with phonegap-rails gem (of which I'm also the author) for assets, fix paths etc.


The answer to this question is going to depend on how you want to deploy this app. Do you want it running completely on the phone or can it be a web app disguised as an iphone/android app?

For the native app solution I'd checkout the Rhodes Framework. It's not RoR but you'll see that it's an MVC framework that feels similar. This will allow you to build native iphone/android apps using Ruby.

For the 2nd option, web app disguised as a mobile app, I'd recommend Sencha Touch. Sencha has done an amazing job mimicking the look and feel of native iphone/android apps with their Javascript library. With this solution it would be just like any other web app though it's targeted for android and iphone via it's UI.


RubyonRails is web application framework - it is running on server and user observer the result of application built on RubyOnRails inside browser(or Browser component), despite the fact that you can process on server just "M" from "MVC", and implement "V" and "C" fully on client side( in mobile browser).

In theory, you can fully deploy RubyOnRails application on client side( even RubyOnRails server and etc), but it will be rather expensive and hard, but it is could not be require in any rational project.

assuming: There are two way you can choose:

  1. Organize RubyonRails application on the server(process there Model), and process "V" and "C" on client side with any proper js libraries.
  2. You can develop Ruby(not RubyOnRails application) - at least it is possible to develop for Android with JRuby.