REST API using Ruby on Rails for iOS app.

Discussion in 'Web Design and Development' started by techwoman, Dec 1, 2016.

  1. techwoman macrumors newbie

    Nov 22, 2014

    Please let me know if this is not the right forum to ask this question. But I wasn't sure where should I post it exactly. Since I need a server for the iOS app that I am building, I thought this would be the best forum as there would be some developers who have been through it already.

    So, here is what I will be doing and the info I need to move further. My app will make a couple of GET requests to collect some data in JSON format and will display it on the app. The data will be hardcoded on the ruby on rails (ROR) library that I will be making. I have done basic ROR coding before, and found some resources online which will help guide me to make a library. But since, I am going to submit my app to the app store, I think I would need a server which would respond to the GET requests (correct me if I am wrong here).

    Are there any existing free tools out there which could serve as a server? Or can I turn my ROR library itself into server that would be always running. Any info or resources regarding creating a server for an app would be helpful.

  2. jtara, Dec 1, 2016
    Last edited: Dec 1, 2016

    jtara macrumors 65816

    Mar 23, 2009
    ROR isn't really a library - it's a "framework". It's a complete application that runs on your server that serves a "hello world" page from the git-go. You then flesh it out, adding models, views, controllers to respond to requests.

    There are multiple web servers to choose from in the ROR world. They each have their plusses and minuses. The default server for Rails 5 is Puma. I haven't used Rails in some time, and in the past whatever Rails server you used would typically be put behind some conventional server, e.g. Apache, nginx for performance. A brief look at Puma suggests it is probably enough on it's own for most typical uses. Anyway, it comes with ROR.

    - What do you mean by "hardcoded"? If you are just going to hard-code some data, you don't need ROR at all. Just put up some static .json files on any web server. If you need to fetch the data from a database, then ROR is a good choice, IMO.

    What language are you using to create your app? Is it fully native? Or hybrid, e.g. PhoneGap/Cordova or similar? You might be interested in knowing that there is a hybrid mobile platform that will allow you to do much of your app programming in Ruby. It supports iOS, Android, and to some degree other mobile platforms (Windows Phone, if anybody cares...) pretty seamlessly. If you already know Ruby, you might want to leverage your Ruby knowledge. It also shares quite a few concepts with ROR and was really modeled after ROR.

    Note that the platform is in transition, so there may be some confusion over the name. It started as a product of Rhomobile Software and originally was called Rhodes. Motorola Solutions bought Rhomobile. Zebra bought Motorola Solutions (or part of it, minus the police radio business). Zebra open-sourced it fully (it's always been mostly open-source) and transferred development responsibility to Tau Technologies. Use the rhomobile (NOT Tau) github source, but the Tau documentation. (confusing, I know!)

    I've worked on a number of Rhodes projects including ones that are in the App Store, though mostly for internal use by companies and distributed on their own Enterprise Stores.

    It's a little-know platform that is my go-to for developing mobile apps. I've used it since version 2.x.

    Feel free to ask any questions if you go that route - I'm probably one of the most experienced developers using the platform. I can't help you much with ROR, as my ROR is rusty. I used it several years ago when working at Sony, developing backend APIs used by Playstation consoles. It was that experience that got me to look at Rhodes and to start developing mobile apps using it, because it allowed me to leverage my ROR knowledge. I do plan on refreshing my ROR knowledge presently! I'm sure there are others here who have more current ROR experience who can answer your ROR questions better.
    --- Post Merged, Dec 1, 2016 ---
    To answer your basic question, though... start here!

Share This Page