Book Image

Rhomobile Beginner's Guide

By : Abhishek Nalwaya
Book Image

Rhomobile Beginner's Guide

By: Abhishek Nalwaya

Overview of this book

The four Rhomobile products – Rhodes, Rhosync, RhoHub, and Rhogallery – provide a complete toolkit for creating a mobile application. Rhomobile is cross-platform and so allows you to build your application for many different types of smartphone – including iPhone and Blackberry – just with a single codebase. This makes it the most preferred and quickest way of developing mobile apps. As you create a native Rhomobile application, you can use the built-in device features such as GPS, Push, and Camera, all with offline capabilities.Rhomobile Beginner's Guide is filled with practical examples to help you to create a mobile application from scratch. You can choose on which operating system to build, as well as for which smartphone to develop your application, giving you the freedom to create a customized mobile application quickly and easily.Once you have learned how to install Rhomobile on Windows, Mac, or Linux, you will create a simple application, which will be used to explore the products of Rhomobile one by one. Things really get going when you write unit test cases for your application before deploying it to the server and making builds for your chosen Smartphone. You will learn about the different aspects of Rhomobile, starting with Rhodes 3, which helps you to build a native mobile application. Rhosync 2.1 carries out the offline device capabilities and RhoHub deploys the code on the server and creates a build for the different smartphones. Rhomobile Beginner's Guide gives you the freedom to create a mobile web application on the platform of your choice, for the smartphone of your choice.
Table of Contents (17 chapters)
Rhomobile Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creation of a new page


We will now add a new page manually in our employee application, which will list all the employee names and their respective designations.

Let us include following use-cases to make our application more interesting:

  • If age < 30 then, designation – Developer

  • If age >= 30 && age <40 then, designation – Senior Developer

  • If age >= 40 then, designation – Architect

Time for action – Creation of the new page

We will now create a new page (employee_details.erb) that will display the employee name and designation.

Follow these steps to create the page:

  1. Create an action employee_details in employee_controller. We write all the database queries using Rhom, which is an ORM of Rhodes:

     def employee_details
         @employee = Employee.find(:all)
      end 

    By adding Employee.find(:all) we will return an array of an object from the Employee Model.

  2. Create a page employee_details.erb and employee_details.bb.erb in the Employee directory and add the following lines to employee_details...