RoR technology: is there any mobile framework on Rails? - ruby-on-rails

Can we make a mobile application with the help of RoR technology?

Ruby on Rails is a webframework designed to, well.. create websites. If you change the website template of RoR to fit the small screens of handhelds/mobile phones/smartphones you can of course use it to serve websites to those devices.
Best wishes,
Fabian

Actually there is, "open source framework Rhodes contains the first implementation of Ruby for every major smartphone operating system: iPhone, Android, BlackBerry, Windows Mobile and Symbian." Also see this.

Related

Using rails with phonegap

I have a fully functional rails app but, I want to create a mobile version using Phonegap. I've got Phonegap and Xcode set up but, I'm not quite sure how to go about it.
I want the mobile version to pull from the same database as the web version.
What technology can I use to achieve this?
Thanks,
Ramario
You should probably expose your database through a REST API abstraction layer either with Rails or a separate application using something like Sinatra, which I personally find better suited to API development.
Then your mobile app can make REST calls to allow users to manipulate data from the same database.
Or you can of course just make your existing web UI mobile-friendly and have people just as easily work with your Rails app through the browsers in their phones as they do the browsers on their laptops.

Need to build mobile UI for a Rails app

I need to begin building a mobile UI for one of my Rails apps. A quick search brought me to the Titanium platform. Any thoughts on using this? Alternate suggestions are also welcome/appreciated.
In addition to my app rendering HTML, I am also able to easily create an API that will render JSON -- if that makes any difference regarding an answer.
Thanks in advance!
No experience with Titanium, but I would start with a Web UI, optimized for mobile (small) devices. This would avoid you to build several (well, two : one Android and one iOS) different clients applications.
Many current web framework now help with building mobile web application (look at Twitter Boostrap responsive features for an example).
You may want a native app afterward, especially if :
You want to interact with the phone/device (get contacts, push notifications, use sensors)
The native look and feel is very important to your application
Even so, a lot of very good apps are actually "hybrids", mixing native widgets with webview (take a look at 37 signals discussion about their new Basecamp iOS app).
In addition, if you are going the native way and are a Ruby developer (which I suppose), you may want to take a look at Ruboto (that allow to code applications for Android in Ruby) and RubyMotion (same for iOS).
I've decided to further pursue using Titanium and will most likely be creating a hybrid app. That said, both JQuery Mobile and Twitter Bootstrap also look nice! Thanks everyone for looking.

Ruby on rails making an app for smartphone

I want to build an app that use in the backend Ruby on Rails. However my problem comes in the lack of information i found on it. My goals is not just to create a website but an application that interacts with it, like my android facebook app when pressing menu I get button like logout and so on.
I am wondering if their exists tutorial on how to build an application but using rails or should i scrap my entire website and do it in php. I am looking for guide and tutorial. Thanks in advance
You can build an app on any platform and make it interact with your Rails-based server using HTTP requests (like AJAX).
You can send information back and forth using JSON or XML; you would probably need to make a new set of actions for the app to use.
There is no reason to use PHP. ever.
A little unclear from your original question, but if you are looking to create a mobile app using Ruby (and a structure similar to Ruby on Rails) then you may be interested in Rhomobile. It is a cross-platform mobile application framework that uses Ruby for its backend code, and follows a structure similar to (older) Ruby on Rails versions.
From what I understand of your problem, you want to use the robustness of Ruby to develop a native app (not just another app that mirrors a website).
The best thing I know of for this is RubyMotion. The bummer is the cost ($200). But then you would get to accomplish your task.

Supporting Mobile Devices in Ruby on Rails

What is the best way to develop a rails application that has special views for different mobile devices?
Basically I'm looking for something like this ASP.NET MVC solution: http://www.hanselman.com/blog/MixMobileWebSitesWithASPNETMVCAndTheMobileBrowserDefinitionFile.aspx
You might be looking for mobile_fu. It's a plugin that automatically changes the Rails format from :html to :mobile for Nokia, Blackberry, iPhone and Palm users. You can then just provide an {action}.mobile.erb to complement {action}.html.erb and it will render the mobile view. If you need something more fine-grained, it allows you to do:
is_mobile_device?
and there's various other helper methods
Two articles that use the iPhone as an example of serving up a different view based on a mobile sub-domain or a by detecting the user-agent. Essentially you'll create a different view using something like viewname.iphone.erb or viewname.mobile.erb and set the request.format variable to iphone or mobile respectively.
iPhone subdomains with Rails
iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2
I found this railscast extremely helpful for this situation: http://railscasts.com/episodes/199-mobile-devices
Hope it helps somebody out.
Ernie Miller wrote a post about how to provide mobile templates for your views. What's nice is that his approach doesn't force you to provide a mobile template if it isn't required. Instead, rails will fall back on your main template if the mobile version isn't found.
I recently wrote an article about this which you might find useful:
http://www.arctickiwi.com/blog/2-mobile-enable-your-ruby-on-rails-site-for-small-screens
Hope that helps
Jonno
I just saw a really illuminating video on this: http://www.engineyard.com/video/12678746 . There is a lot more to a decent mobile web experience then directly porting pages.
You might want to try Mobvious - https://github.com/jistr/mobvious
Detects mobiles vs. desktops + tablets, or if you want, detects mobile vs. tablets vs. desktops.
It also has support for manual selection by users (overriding the detection) if you want to allow users to manually switch interface versions.
And there is an extension mobvious-rails that adds some helpers to your controllers, views and CoffeeScript.

Options for distribution of an offline Ruby on Rails application

I am developing an application in using Ruby on Rails, mostly as an excuse to learn the language.
This is not intended to be a web-based application - and perhaps I have chosen the wrong language, but...
My understanding is, that in order to run an instance of this application on somebody else's computer, they would need to install ruby on rails, and a webserver (or webrick, perhaps), as well as my application code.
I am just curious if there are any other options for distributing my application as a standalone app, or perhaps just a simple way to package up a web browser and ROR together with my app for a simple, one-step install?
I have personally never needed to do this. But, I have ran across this tutorial http://www.erikveen.dds.nl/distributingrubyapplications/rails.html that I think will be helpful. The tutorial covers how to actually convert a rails app into a standalone exe file.
Note, Slingshot appears to be a dead project (see comments). I'll leave this answer here for historical purposes and the off-chance that it comes back
Joyent's Slingshot might be a good bet.
Joyent Slingshot allows developers to deploy Rails applications like a standard desktop application, which work online and offline (with synchronization), have drag and drop, and interact with all the other desktop applications.
With Joyent Slingshot:
Create a hybrid Web/desktop application
Synchronize online and offline data
Use the same code for online and offline application(s)
Deploy and update your application easily
Drag into and out of application
Here are some further links to help with your evaluation and/or to help you get started:
Introducing Joyent Slingshot
Basic application walkthrough
Slingshot wiki
The way most people ship ruby programs, including Rails webapps, as a standalone exe is via rubyscript2exe. They describe how to package a Rails application at http://www.erikveen.dds.nl/distributingrubyapplications/rails.html. Ruby, Rails, and all the associated libraries will be included in the EXE file.
As others mentioned, Ruby is not necessarily Rails and if you really want an easy way to write a distributable GUI application in Ruby, Shoes is an excellent place to start looking.
Gears on Rails maybe?
You could always consider compiling your Ruby to JVM byte-code (via JRuby) or .NET byte-code (via IronRuby) to distribute to people who have those virtual machines and don't want to install a Ruby runtime.
You might want to check out Shoes for building desktop applications in Ruby. Rails really is tuned for building websites.
You can include Ruby on Rails by freezing it to the version of Rails you want to use in your project. They call this Freezing. The user will not have to install Rails to use your application. You can do this with any library you use in your project. If the project uses a library, just place it under the Vendor folder in your project. Then use a tool similar to what #Josh answered with to package it.
You will need a web server to run the project though. There is no way around this. Ruby on Rails is just like ASP.NET in this regard, in that it is a server side framework. The server runs the code and outputs the HTML to the browser by using the Rails framework.
Unfortunately, you may have picked the wrong framework to do what you want. Instead of Ruby on Rails, you may want to check out Shoes, which is a framework for developing GUI applications using Ruby.
You do not specifically say whether it is supposed to be a GUI application or not. From the other answers, I would guess so.
Therefore, you need to clarify what your goals are. RoR is a specialized framework for web applications. If your goal is to learn RoR, I'd say to get yourself some inexpensive web hosting and make yourself an app. If your goal is to learn Ruby, not necessarily Rails, then Shoes, IronRuby, JRuby, MacRuby and others may be good options to look at.

Resources