19.11.2012 Views

Ruby on Rails - Bad Request - University of Calgary

Ruby on Rails - Bad Request - University of Calgary

Ruby on Rails - Bad Request - University of Calgary

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong><br />

Mitchell Craig; Tam Nguyen; Becker Luu; Eliezer Mar Manarang; and Colin Williams<br />

<strong>University</strong> <strong>of</strong> <strong>Calgary</strong> SENG 403 Dr. Kremer<br />

Abstract—The proceeding document describes the <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong><br />

<strong>Rails</strong> web applicati<strong>on</strong> framework. A history is provided, al<strong>on</strong>g<br />

with the founding Philosophies and Priciples, Technical Informati<strong>on</strong>,<br />

Notable Applicati<strong>on</strong>s and a comparis<strong>on</strong> to competitors.<br />

A short tutorial is provided as an example.<br />

I. INTRODUCTION<br />

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> [1] (<strong>of</strong>ten referred to as <strong>Rails</strong> or RoR)<br />

is an open source web applicati<strong>on</strong> development framework<br />

that is written in the <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> [2] programming language. The<br />

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> framework is designed to make programming<br />

web applicati<strong>on</strong>s easier by making assumpti<strong>on</strong>s <strong>on</strong> what the<br />

developer requires to get started <strong>on</strong> their applicati<strong>on</strong>s. <str<strong>on</strong>g>Ruby</str<strong>on</strong>g><br />

<strong>on</strong> <strong>Rails</strong> is a development tool which assists developers in<br />

building websites and applicati<strong>on</strong>s because it abstracts and<br />

simplifies the comm<strong>on</strong>ly used and repetitive tasks. What this<br />

means is that the programmers <strong>on</strong>ly have to write new code<br />

in areas where their applicati<strong>on</strong> differs from the standard<br />

c<strong>on</strong>venti<strong>on</strong>s. Using <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong>, the programmers are able<br />

to write less code while producing more output than with<br />

other development frameworks. Highlighted in this report<br />

is an overview <strong>of</strong> the philosophies and principles behind<br />

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong>, an in-depth look at the technical aspects<br />

<strong>of</strong> the framework as well as comparis<strong>on</strong>s to other similar<br />

technologies. Finally, the report includes a tutorial <strong>on</strong> getting<br />

setup with the <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> framework and getting started<br />

with developing a simple web applicati<strong>on</strong>.<br />

II. HISTORY OF RUBY ON RAILS<br />

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> was created in 2003 by David Heinemeier<br />

Hanss<strong>on</strong>. Hanss<strong>on</strong> developed the original framework for<br />

<strong>Rails</strong> while he was working <strong>on</strong> <str<strong>on</strong>g>Ruby</str<strong>on</strong>g>-based projects for<br />

37signals[3], a web applicati<strong>on</strong> company. <strong>Rails</strong> was extracted<br />

from some <strong>of</strong> Hanss<strong>on</strong>s work <strong>on</strong> Basecamp, a project<br />

management tool developed by 37signals.<br />

<strong>Rails</strong> was first released publicly released in July 2004 as<br />

an open source project. The project had reached a milest<strong>on</strong>e<br />

in 2006 when Apple announced that <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> would<br />

be bundled together with Mac OS X v10.5 Leopard which<br />

later released in 2007.<br />

The <strong>Rails</strong> framework is based <strong>on</strong> established principles<br />

that had been proven successful elsewhere and is focused <strong>on</strong><br />

practicality which is the reas<strong>on</strong> behind why it has become<br />

so successful. With the release <strong>of</strong> <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong>, <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> has<br />

risen to become a prominent alternative for other classic<br />

languages such as PHP and Java for developing websites and<br />

web applicati<strong>on</strong>s. Thousands <strong>of</strong> web applicati<strong>on</strong>s around the<br />

world have been developed using <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> with some<br />

notable examples such as Twitter, Yellow Pages, Github and<br />

Hulu. Today, the <strong>Rails</strong> framework is supported by the <strong>Rails</strong><br />

core team c<strong>on</strong>sisting <strong>of</strong> a dozen members who have been<br />

given the keys to the source repository as well as more<br />

than 2,100 c<strong>on</strong>tributors to the project. The framework is<br />

supported by a vibrant ecosystem which includes various<br />

choices in hosting, tools, editors, c<strong>on</strong>ferences, workshops<br />

and c<strong>on</strong>sultants.<br />

III. PHILOSOPHIES AND PRINCIPLES<br />

There are three primary philosophies or principles[4] behind<br />

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong>: C<strong>on</strong>venti<strong>on</strong> over C<strong>on</strong>figurati<strong>on</strong> (CoC),<br />

D<strong>on</strong>t Repeat Yourself (DRY) and Representati<strong>on</strong>al State<br />

Transfer (REST).<br />

The first key principle is C<strong>on</strong>venti<strong>on</strong> over C<strong>on</strong>figurati<strong>on</strong>.<br />

The <strong>Rails</strong> framework is designed with c<strong>on</strong>venti<strong>on</strong>s that tell<br />

you how you should structure your code, how to name your<br />

classes and files and how to organize your databases and<br />

tables. The framework makes large assumpti<strong>on</strong>s about what<br />

you want to do and how you want to do it so that you d<strong>on</strong>t<br />

need to explicitly specify it. The benefit <strong>of</strong> having these<br />

c<strong>on</strong>venti<strong>on</strong>s is that it simplifies and reduces the amount<br />

<strong>of</strong> code that you actually need to write when developing<br />

your web applicati<strong>on</strong>. What this means when developing is<br />

that <strong>on</strong>ly the unc<strong>on</strong>venti<strong>on</strong>al aspects <strong>of</strong> the program need<br />

to be written. This allows for better productivity and high<br />

efficiency since the repetitive or comm<strong>on</strong> tasks are already<br />

automatically completed for you. Of course, there is the<br />

opti<strong>on</strong> to ignore these c<strong>on</strong>venti<strong>on</strong>s and structure the code to<br />

your own preferences but this means that more unnecessary<br />

work is being d<strong>on</strong>e. This principle makes <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> a<br />

bit <strong>of</strong> an opini<strong>on</strong>ated framework[5] and is largely a reas<strong>on</strong><br />

why the framework is named <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong>. If you decide to<br />

follow the c<strong>on</strong>venti<strong>on</strong>s that have been set out, you will enjoy<br />

the benefits <strong>of</strong> using <strong>Rails</strong> for developing your applicati<strong>on</strong>s.<br />

If you d<strong>on</strong>t c<strong>on</strong>form to the style that the framework was<br />

built <strong>on</strong>, it may not work well for you.<br />

The sec<strong>on</strong>d key principle is DRY which stands for D<strong>on</strong>t<br />

Repeat Yourself. This principle suggests that writing the<br />

same code over and over again is a bad thing. The main<br />

idea behind the DRY principle is that it promotes the reuse<br />

<strong>of</strong> code as <strong>of</strong>ten as possible rather than duplicating and<br />

rewriting similar code in multiple places. <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong><br />

follows the DRY principle to help in maintaining clean code


and reducing the chance <strong>of</strong> errors in the code. Having DRY<br />

code in your program means that changes <strong>on</strong>ly need to be<br />

made at <strong>on</strong>e locati<strong>on</strong> rather having to revise changes in all<br />

different locati<strong>on</strong>s. If an error were to occur, it would be<br />

a lot more traceable and easier to detect the root cause <strong>of</strong><br />

the error. <strong>Rails</strong> is designed with and provides libraries that<br />

assist in writing DRY code.<br />

The last principle <strong>of</strong> <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> is REST or Representati<strong>on</strong>al<br />

State Transfer[6]. This is not <strong>on</strong>e <strong>of</strong> the primary<br />

philosophies <strong>of</strong> <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> but in recent years, the<br />

<strong>Rails</strong> community has moved towards following the RESTful<br />

architecture. Unlike the other philosophies <strong>of</strong> <strong>Rails</strong>, it is not<br />

a requirement for the applicati<strong>on</strong> to follow a REST design.<br />

It is encouraged that developers follow the REST design and<br />

the framework provides tools that make it easier to do so.<br />

REST is a pattern for making web applicati<strong>on</strong>s which<br />

organizes the applicati<strong>on</strong> around resources and standard<br />

HTTP verbs. With REST, there are three key ideas. The<br />

first is proper identificati<strong>on</strong> <strong>of</strong> resources, the sec<strong>on</strong>d is the<br />

manipulati<strong>on</strong> <strong>of</strong> the resources and the last is to have selfdescriptive<br />

messages that are easy to interpret. Resources<br />

are <strong>of</strong>ten the core model objects in the program. The main<br />

idea behind the RESTful design is to identify and manipulate<br />

resources using a standard c<strong>on</strong>venti<strong>on</strong> that is self-descriptive.<br />

As an example, the following HTTP request, DELETE<br />

/photos/17 can be easily understood as referencing a photo<br />

resource with an ID number <strong>of</strong> 17. The standard HTTP<br />

verb being used in this case is the delete functi<strong>on</strong>ality. The<br />

purpose behind using REST in <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> is to provide<br />

a simplified design pattern that is clear and straightforward.<br />

This can be especially helpful if the applicati<strong>on</strong> being<br />

developed is an open source project. Following a comm<strong>on</strong><br />

pattern like REST for all applicati<strong>on</strong>s using <strong>Rails</strong> means that<br />

all developers will have a good understanding <strong>of</strong> the coding<br />

style and practices.<br />

The philosophies and principles <strong>of</strong> <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> are very<br />

closely related within the framework. They all aim towards<br />

simplifying and making the process <strong>of</strong> developing web applicati<strong>on</strong>s<br />

as simple as possible. C<strong>on</strong>venti<strong>on</strong> over C<strong>on</strong>figurati<strong>on</strong><br />

focuses <strong>on</strong> making the development process straightforward<br />

and increasing productivity by abstracting the comm<strong>on</strong> and<br />

repetitive tasks so that the developer <strong>on</strong>ly needs to be focus<br />

<strong>on</strong> the new aspects to be implemented rather than having to<br />

worry about the unnecessary c<strong>on</strong>venti<strong>on</strong>al aspects. The DRY<br />

philosophy focuses <strong>on</strong> having to write code <strong>on</strong>ly <strong>on</strong>ce and<br />

reusing it as much possible when that particular functi<strong>on</strong>ality<br />

is needed. Once again, this increases productivity since it<br />

reduces the amount <strong>of</strong> code that needs to be written. It<br />

also helps because it allows for better traceability <strong>of</strong> the<br />

code which makes it easier to make revisi<strong>on</strong>s. Following<br />

the RESTful design, the design <strong>of</strong> code follows a certain<br />

standard which all developers can interpret and understand.<br />

When <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> is used with these principles and<br />

philosophies in mind, the result is having cleaner and more<br />

reliable code. Less work and code is required from the<br />

developers which results in higher productivity.<br />

IV. TECHNICAL INFORMATION<br />

This secti<strong>on</strong> describes <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong>[7] basic technical<br />

informati<strong>on</strong>: the structure <strong>on</strong> how it works, classes that are<br />

needed for development, and the framework that it supplies<br />

aiding the web applicati<strong>on</strong> development. Also, some tools<br />

for deployment <strong>of</strong> the applicati<strong>on</strong> is tackled briefly. The informati<strong>on</strong><br />

stated here are mainly learned/cited from sources<br />

[8], [9], and [10] for the system architecture/informati<strong>on</strong> and<br />

development tools, and [11] c<strong>on</strong>tains the recommended tools<br />

for deployment.<br />

A. Introducti<strong>on</strong><br />

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> is a development framework for developing<br />

a web applicati<strong>on</strong>. <strong>Rails</strong> <strong>of</strong>fers libraries for development<br />

ranging from the user interface up to managing the data and<br />

processing it. This is why <strong>Rails</strong> is called a full-stack web<br />

applicati<strong>on</strong> development framework - usable to create all<br />

functi<strong>on</strong>ality <strong>of</strong> a working web applicati<strong>on</strong>.The availability<br />

<strong>of</strong> the different libraries and given the founding philosophies<br />

<strong>of</strong> <strong>Rails</strong>, which is the basis <strong>of</strong> a <strong>Rails</strong> project default c<strong>on</strong>figurati<strong>on</strong>,<br />

are giving <strong>Rails</strong> the ability to automatically link<br />

different aspects and classes <strong>of</strong> a created project resulting<br />

for the developers ease <strong>of</strong> use <strong>of</strong> the system. Though the<br />

drawback <strong>of</strong> following a default c<strong>on</strong>figurati<strong>on</strong> for the <strong>Rails</strong><br />

framework is that it <strong>of</strong>fers little flexibility <strong>on</strong> c<strong>on</strong>figurati<strong>on</strong><br />

management and design for the developer. The basic features<br />

that <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> provides for the applicati<strong>on</strong> development<br />

are: [10]<br />

• HTML [12] templating (which involves the view comp<strong>on</strong>ent<br />

<strong>of</strong> the applicati<strong>on</strong>).<br />

• Database storage/retrieval (involves the model classes<br />

in the applicati<strong>on</strong>).<br />

• User Web browser requests and resp<strong>on</strong>se (involves the<br />

c<strong>on</strong>troller classes in the applicati<strong>on</strong>).<br />

• HTML form handling.<br />

B. Directory Structure<br />

When creating a project <strong>on</strong> <strong>Rails</strong>, <strong>Rails</strong> creates a predefined<br />

directory structure to c<strong>on</strong>tain the files needed for the<br />

project to work. Below are the directory names that could<br />

be seen in a <strong>Rails</strong> project, and a brief descripti<strong>on</strong> <strong>of</strong> each:<br />

[10]<br />

app<br />

The folder that c<strong>on</strong>tains all developed code for the<br />

project that are related to the MVC [13] architecture.<br />

It means that it c<strong>on</strong>tains the model classes,<br />

the c<strong>on</strong>troller classes, and the view templates for<br />

the applicati<strong>on</strong>.<br />

c<strong>on</strong>fig<br />

C<strong>on</strong>tains the c<strong>on</strong>figurati<strong>on</strong> files for the applicati<strong>on</strong>.


db<br />

doc<br />

lib<br />

log<br />

It c<strong>on</strong>tains the database schema and migrati<strong>on</strong><br />

files for model classes and database entities. Even<br />

though that <strong>Rails</strong> is a full-stack framework for web<br />

applicati<strong>on</strong> development, the applicati<strong>on</strong> still needs<br />

to have a separate database to store the data needed<br />

by the applicati<strong>on</strong>.<br />

This c<strong>on</strong>tains the documentati<strong>on</strong> made for the<br />

applicati<strong>on</strong> that is being developed.<br />

Code developed for the applicati<strong>on</strong> that are not part<br />

<strong>of</strong> the MVC classes and code files.<br />

Log files for the applicati<strong>on</strong>. These are automatically<br />

created by <strong>Rails</strong>.<br />

public<br />

C<strong>on</strong>tains the static files needed by the applicati<strong>on</strong>.<br />

(i.e images)<br />

script<br />

C<strong>on</strong>tains <strong>Rails</strong> scripts for different utilities needed<br />

by the applicati<strong>on</strong>.<br />

test<br />

Folder to c<strong>on</strong>tain test code for the applicati<strong>on</strong>.<br />

tmp<br />

Files needed by the applicati<strong>on</strong> that are related to<br />

web service.<br />

vendor<br />

Plugins installed in <strong>Rails</strong> that are being used by<br />

the applicati<strong>on</strong>.<br />

C. MVC[13]<br />

One <strong>of</strong> <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> main technical highlight is that<br />

the projects created follows the principle <strong>of</strong> Model-View-<br />

C<strong>on</strong>troller design architecture in arranging the applicati<strong>on</strong>s<br />

functi<strong>on</strong>ality. Model classes represents the object linked<br />

from an existing database and its business logic features in<br />

manipulating the data. View are the templates that are being<br />

rendered to be shown to the user depending what the user<br />

needs to see. C<strong>on</strong>troller is the interface for the applicati<strong>on</strong><br />

users web browser, it handles requests between the browser,<br />

communicates with models to process the data needed, and<br />

renders the view templates and sends it back to the browser.<br />

The diagram below shows the simple interacti<strong>on</strong> <strong>of</strong> a users<br />

web browser to a MVC system.<br />

There are main comp<strong>on</strong>ents and libraries built-in <strong>on</strong> <strong>Rails</strong><br />

to support and design the MVC architecture for the web<br />

applicati<strong>on</strong> development: ActiveRecord library is to support<br />

Model classes in linking to database entities, Acti<strong>on</strong>C<strong>on</strong>troller<br />

module <strong>on</strong> Acti<strong>on</strong>Pack library is the base class for all<br />

c<strong>on</strong>troller objects for the project, and Acti<strong>on</strong>View module<br />

<strong>on</strong> Acti<strong>on</strong>Pack library assists in developing the templates<br />

needed for different view.<br />

Figure 1. A simple diagram showing how MVC architecture works, in<br />

c<strong>on</strong>text <strong>of</strong> <strong>Rails</strong>.<br />

1) Model - ActiveRecord Library: To represent a Model<br />

layer in the project being created, <strong>Rails</strong> has a library called<br />

ActiveRecord to implement model classes and linking it<br />

to the web applicati<strong>on</strong> database. ActiveRecord library and<br />

its c<strong>on</strong>cept is based <strong>on</strong> [14], a design c<strong>on</strong>cept created<br />

by Martin Fowler. The c<strong>on</strong>cept <strong>of</strong> ActiveRecord is that it<br />

first maps relati<strong>on</strong>al databases into object classes, which<br />

is called Object Relati<strong>on</strong>al Mapping [15]. The mapping is<br />

d<strong>on</strong>e due to the fact that relati<strong>on</strong>al tables are structured<br />

differently compared to object oriented classes. Typically<br />

a relati<strong>on</strong>al database table could be traced as an object<br />

class with the column descripti<strong>on</strong> as attributes and each<br />

row is an object <strong>of</strong> the class. But with additi<strong>on</strong> <strong>of</strong> foreign<br />

keys, disjoint, overlap, and other relati<strong>on</strong>al database table<br />

characteristics, the differences between relati<strong>on</strong>al database<br />

entities and object oriented is evident, thus it needs to be<br />

mapped or c<strong>on</strong>verted for object-oriented use <strong>of</strong> the system.<br />

Each relati<strong>on</strong>al database row and its attributes are encapsulated<br />

within object classes. And then the class definiti<strong>on</strong><br />

c<strong>on</strong>tains data access methods for the specific data in the<br />

database table. Also. it also c<strong>on</strong>tains other business logic<br />

processing methods to manipulate the attributes <strong>of</strong> the object<br />

and the linked data in the database if needed. This class<br />

that represents the data from the database is called a Model,<br />

and the relati<strong>on</strong>ship between Models are called Associati<strong>on</strong>s.<br />

Associati<strong>on</strong>s can define model hierarchy and associati<strong>on</strong><br />

cardinality between models. ActiveRecord::Base is the base<br />

class for creating models and also for creating associati<strong>on</strong>s<br />

between models.<br />

2) C<strong>on</strong>troller - Acti<strong>on</strong>C<strong>on</strong>troller Module: C<strong>on</strong>troller<br />

classes are the classes that handles the communicati<strong>on</strong><br />

between the c<strong>on</strong>tent <strong>of</strong> the applicati<strong>on</strong> (View rendering and


Model data manipulati<strong>on</strong>) and the request/resp<strong>on</strong>se handling<br />

<strong>of</strong> Users web browser. Thus, <strong>on</strong>ly the C<strong>on</strong>troller layer <strong>on</strong> the<br />

MVC architecture should know the methods that relates in<br />

browser requests and resp<strong>on</strong>se. Acti<strong>on</strong>C<strong>on</strong>troller class under<br />

the Acti<strong>on</strong> Pack library in <strong>Rails</strong> represents the c<strong>on</strong>troller<br />

class that the applicati<strong>on</strong> needs. Usually, each model (or each<br />

web page/view) should have its own c<strong>on</strong>troller class, and<br />

each active entity in the view that a user could interact that<br />

produces a request should have its own method inside the<br />

c<strong>on</strong>troller class. These methods are called acti<strong>on</strong> methods,<br />

which handles the process flow, or routing, within the<br />

system. The handling <strong>of</strong> acti<strong>on</strong> method routing could be<br />

either predefined or could be c<strong>on</strong>figured by the developer.<br />

The ancestor class for all Acti<strong>on</strong>C<strong>on</strong>troller class within the<br />

project is called Acti<strong>on</strong>C<strong>on</strong>troller::Base.<br />

3) View-Acti<strong>on</strong>View Module: The view layer handles the<br />

display structure that the user sees in using applicati<strong>on</strong> in<br />

a given time. Based <strong>on</strong> our experiences using the web, we<br />

could all say that many website servers uses different layouts<br />

for different webpages <strong>of</strong> different purposes. It is the view<br />

layer that handles these different layout views depending <strong>on</strong><br />

which aspect <strong>of</strong> the applicati<strong>on</strong> is being viewed by the user.<br />

In <strong>Rails</strong>, it is the Acti<strong>on</strong>View module inside the Acti<strong>on</strong> Pack<br />

library that handles the different views that the applicati<strong>on</strong><br />

could have. Views in <strong>Rails</strong> are usually templates composed<br />

<strong>of</strong> HTML [12] files and .erb (embedded ruby) [16] files.<br />

Given that this layer handles the template for views, this<br />

layer must not have any business logic methods inside it.<br />

D. Other Comp<strong>on</strong>ents or Libraries<br />

Aside from the main <strong>on</strong>es discussed above that handles<br />

the core architecture <strong>of</strong> the project, there are also other<br />

comp<strong>on</strong>ents and libraries that <strong>Rails</strong> have for additi<strong>on</strong>al<br />

implementati<strong>on</strong> <strong>of</strong> the designed applicati<strong>on</strong>:<br />

Acti<strong>on</strong>Dispatch<br />

Part <strong>of</strong> the Acti<strong>on</strong> Pack library (that includes Acti<strong>on</strong>C<strong>on</strong>troller<br />

and Acti<strong>on</strong>View), Acti<strong>on</strong>Dispatch<br />

are a set <strong>of</strong> classes that handles web request routing<br />

and dispatch to applicati<strong>on</strong>s.<br />

Acti<strong>on</strong>Mailer<br />

A comp<strong>on</strong>ent for email services development for<br />

the applicati<strong>on</strong> being developed. It enables the applicati<strong>on</strong><br />

to send, process, and receive emails. The<br />

base class Acti<strong>on</strong>Mailer::Base are the parent class<br />

for mailer models in the system that are being used<br />

for the email functi<strong>on</strong>ality being implemented.<br />

ActiveModel<br />

It is an interface between the Acti<strong>on</strong> Pack library<br />

comp<strong>on</strong>ents and Object-Relati<strong>on</strong>al Mapping<br />

comp<strong>on</strong>ents (i.e. ActiveRecord). This enables the<br />

developer to have c<strong>on</strong>figurati<strong>on</strong> c<strong>on</strong>trol over the<br />

usage <strong>of</strong> other ORM frameworks if it is not desired<br />

to use ActiveRecord as the applicati<strong>on</strong>s default<br />

ORM.<br />

ActiveResource<br />

It is a framework to link objects and RESTful [6]<br />

web services. It is similar to ActiveRecord, it does<br />

Object-Relati<strong>on</strong>al Mapping to model REST web<br />

services into objects.<br />

ActiveSupport<br />

Collecti<strong>on</strong> <strong>of</strong> utility classes for <strong>Rails</strong> usage. Could<br />

also be used for the development <strong>of</strong> the applicati<strong>on</strong>.<br />

Railities<br />

The core or the center <strong>of</strong> <strong>Rails</strong> code, which defines<br />

<strong>on</strong> how <strong>Rails</strong> functi<strong>on</strong>s as a framework for<br />

developing projects for web applicati<strong>on</strong>s.<br />

E. Tools to Aid <strong>Rails</strong> Development<br />

As stated above, <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> provides the classes and<br />

the framework needed by the developer to develop their<br />

desired web applicati<strong>on</strong>. Aside from the framework, <strong>Rails</strong><br />

also provide tools to aid development <strong>of</strong> the applicati<strong>on</strong>,<br />

ranging from c<strong>on</strong>sole tools up to automatic code generati<strong>on</strong><br />

tools that satisfies the philosophy <strong>of</strong> <strong>Rails</strong> development.<br />

1) <strong>Rails</strong> C<strong>on</strong>sole: <strong>Rails</strong> c<strong>on</strong>sole is an extensi<strong>on</strong> <strong>of</strong> Interactive<br />

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> c<strong>on</strong>sole (irb) [16] - the command-line c<strong>on</strong>sole in<br />

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> to aid <str<strong>on</strong>g>Ruby</str<strong>on</strong>g>-based development. Similar to irb, <strong>Rails</strong><br />

c<strong>on</strong>sole is extended to aid developers <strong>of</strong> <strong>Rails</strong> applicati<strong>on</strong> for<br />

setting up the system, for development, and for debugging.<br />

Command-line c<strong>on</strong>soles aids in viewing the system state in a<br />

given system instance, and helps the developer to c<strong>on</strong>trol the<br />

system in a more powerful manner compared to managing<br />

<strong>on</strong>ly the applicati<strong>on</strong>s view interface in a web browser for<br />

further debugging.<br />

2) WEBrick: WEBrick [17] is a package provided in<br />

<strong>Rails</strong> to provide aid in applicati<strong>on</strong> development in terms<br />

<strong>of</strong> local hosting the project before the actual deployment.<br />

The applicati<strong>on</strong>, before release, still needs to be hosted<br />

somewhere for its development and testing. WEBrick is<br />

local web server so that the applicati<strong>on</strong> could be hosted<br />

for its further development by the developer. One feature <strong>of</strong><br />

WEBrick is that changes applied to the project being hosted<br />

automatically updates the server, thus removing the time<br />

overhead spent for restarting the server for the developer to<br />

see the change in accessing the applicati<strong>on</strong> in a web browser.<br />

3) Code Generati<strong>on</strong>Scripts and Migrati<strong>on</strong> Files: These<br />

are the comp<strong>on</strong>ents <strong>of</strong> <strong>Rails</strong> that helps the developer create<br />

the applicati<strong>on</strong> project easier and faster. The generati<strong>on</strong><br />

scripts helps in generating the skelet<strong>on</strong> model and c<strong>on</strong>troller<br />

classes needed by the system. It also helps in creating unit<br />

tests for the classes being generated, and it also creates<br />

migrati<strong>on</strong> files that handles the recogniti<strong>on</strong> <strong>of</strong> the applicati<strong>on</strong><br />

to the database schema being used. Both code generati<strong>on</strong><br />

scripts and migrati<strong>on</strong> files helps by automatically generating<br />

code for the applicati<strong>on</strong> when the user follows the default<br />

c<strong>on</strong>figurati<strong>on</strong> <strong>of</strong> the system.


F. Deployment<br />

After the development <strong>of</strong> the applicati<strong>on</strong>, it needs to be<br />

deployed as a web service as a form <strong>of</strong> release for clients usage.<br />

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> website [11] recommends some external<br />

tools to help the developer deploy their project to the internet<br />

community. One <strong>of</strong> the suggested tools in [11] is Phusi<strong>on</strong><br />

Passenger a.k.a. mod rails [18]. The deployment process <strong>of</strong><br />

the web applicati<strong>on</strong> developed relies <strong>on</strong> the specific tool<br />

being used. Adding additi<strong>on</strong>al informati<strong>on</strong> about each tools<br />

process for deployment is outside <strong>of</strong> the scope <strong>of</strong> this report.<br />

Please see [11] for available tools for <strong>Rails</strong> applicati<strong>on</strong><br />

deployment.<br />

V. TUTORIAL<br />

A. Setting up <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> and <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong><br />

Setting up <strong>Rails</strong> is a little more work for those that are<br />

used to using PHP and having little to no set up required.<br />

However, this initial set up time is worth it. Time will<br />

quickly be made up for due to the speed at which a web<br />

applicati<strong>on</strong> can be developed with <strong>Rails</strong>. The first step <strong>on</strong><br />

the path to fast web development is installing <str<strong>on</strong>g>Ruby</str<strong>on</strong>g>.<br />

For dem<strong>on</strong>strati<strong>on</strong> purposes, the versi<strong>on</strong> <strong>of</strong> <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> we<br />

suggest is 1.8.7 p358, which can be downloaded free from<br />

http://rubyforge.org/frs/shownotes.php?release id=46588<br />

for Windows. When prompted to integrate into PATH,<br />

yes should be checked for c<strong>on</strong>venience. After the installer<br />

finishes <str<strong>on</strong>g>Ruby</str<strong>on</strong>g>Gems, a package manager, can be installed<br />

by typing gem update –system’.<br />

Next, the Devkit should be installed from<br />

http://rubyinstaller.org/downloads. After extracting and<br />

navigating to the downloaded Devkit in command prompt,<br />

the ruby dk.rb init’ and ruby dk.rb install commands will<br />

finish the installati<strong>on</strong>. What the Devkit does is install<br />

necessary gems for the next step: installing <strong>Rails</strong>.<br />

With <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> and the Devkit installed, running gem install<br />

rails at a command prompt will finally install <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong>!<br />

Now the envir<strong>on</strong>ment is ready to create a new project (applicati<strong>on</strong>).<br />

All that needs to be run is rails new project name;<br />

adding -d mysql will use a MySQL database which you will<br />

need to install separately. In additi<strong>on</strong> to installing MySQL,<br />

you need to install a gem for it by running gem install mysql.<br />

MySQL installati<strong>on</strong> is probably the hardest part <strong>of</strong> the<br />

process. After installing MySQL Server and C<strong>on</strong>nectors<br />

from<br />

http://dev.mysql.com/downloads/mirror.php?id=405845#mirrors,<br />

you must manually copy the LIBMYSQL.dll file, as rails<br />

and ruby will not do it for you. This file can be found at,<br />

for example,<br />

C:\Program Files\MySQL\C<strong>on</strong>nector C 6.0.2\<br />

lib\opt<br />

and must be placed in the<br />

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g>\bin<br />

folder. Now youre ready to use <strong>Rails</strong> with MySQL.<br />

One <strong>of</strong> the few helpful commands to know while using<br />

<strong>Rails</strong> is rake. This is <str<strong>on</strong>g>Ruby</str<strong>on</strong>g>s versi<strong>on</strong> <strong>of</strong> make (<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> Make). It<br />

uses a type <strong>of</strong> makefile to run tasks and builds. One example<br />

is rake db:create which creates all <strong>of</strong> your databases for the<br />

applicati<strong>on</strong>. Another helpful tool is bundle, a dependency<br />

manager. For example bundle install should install all the<br />

dependencies/gems that your applicati<strong>on</strong> requires.<br />

Now, you are ready to test your <strong>Rails</strong> installati<strong>on</strong>. After<br />

creating a project, navigate to its root directory and run rails<br />

server. This will start up WEBrick, a simple ruby server,<br />

through which you can view your web applicati<strong>on</strong>. Just<br />

navigate to localhost:3000 in your favourite web browser.<br />

The default welcome to rails page should show; just follow<br />

the instructi<strong>on</strong>s to get started making your first project!<br />

B. Learn to Math<br />

First we want to create a project, open command prompt<br />

and type the command:<br />

rails new MathProject -d mysql<br />

Go into the new MathProject directory. As you can see<br />

this set up a lot <strong>of</strong> folders and files. Since this is a short<br />

tutorial, the folders you need to know about are apps, c<strong>on</strong>fig<br />

and db. The apps folder c<strong>on</strong>tains your models, view and<br />

c<strong>on</strong>troller folders. The db folder has a migrate folder that<br />

c<strong>on</strong>tains the entities in your database. Finally the c<strong>on</strong>fig<br />

folder has the file routes.rb which c<strong>on</strong>tains your routes -<br />

the links you use to redirect <strong>on</strong> your website.<br />

We are going to use Nifty to auto-generate files for user<br />

authenticati<strong>on</strong>. First modify the Gemfile, uncomment the<br />

line:<br />

gem ’bcrypt-ruby’, ’˜> 3.0.0’<br />

(this is used for encrypti<strong>on</strong>), also add the line<br />

gem "nifty-generators", :group => :development<br />

Now run the command<br />

bundle install<br />

which will install nifty generators. Nifty generators is auto<br />

generati<strong>on</strong> s<strong>of</strong>tware which we will use to make our User.<br />

Create the table using:<br />

rails generate nifty:authenticati<strong>on</strong><br />

rails generate nifty:layout<br />

rake db:migrate<br />

This will create a User entity in the database with an id,<br />

username, email, password, password hash, password salt,<br />

created at, and updated at columns. Users are authenticated<br />

using the BCrypt encrypti<strong>on</strong> gem.<br />

It also creates a bunch <strong>of</strong> web pages and ruby files<br />

c<strong>on</strong>taining classes and functi<strong>on</strong>s to log in, check passwords,<br />

etc.


Check the file user.rb, if<br />

require ’bcrypt’<br />

isnt at the top <strong>of</strong> the file and<br />

include BCrypt<br />

isnt at the beginning <strong>of</strong> the User class, add them.<br />

When some<strong>on</strong>e goes to our site we want them to go to<br />

the auto-generated file views/sessi<strong>on</strong>s/new.html.erb.<br />

To do this well have to change the route inside c<strong>on</strong>fig/routes.db.<br />

Uncomment and modify the root route:<br />

root :to => ’sessi<strong>on</strong>s#new’<br />

Since this is going to be a math website, we want users<br />

to have a score for how many questi<strong>on</strong>s they got right. Find<br />

and modify the accessible attributes:<br />

attr_accessible :username, :email,<br />

:password, :password_c<strong>on</strong>firmati<strong>on</strong>, :score<br />

Also add the score to create users.db<br />

t.string :password_hash<br />

t.string :password_salt<br />

=> t.integer :score<br />

Drop the database and (inside command prompt) recreate<br />

it with<br />

rake db:create<br />

rake db:migrate<br />

Now the the database has been recreated with a score<br />

column.<br />

Now we want to be able to add, update, and get our score.<br />

Add this to the User class inside user.rb.<br />

def increase_Score()<br />

update_attributes(:score => score+1)<br />

end<br />

def decrease_Score()<br />

update_attributes(:score => score-1)<br />

end<br />

def get_Score<br />

return score<br />

end<br />

In increase Score() and decrease Score() the update<br />

attributes() functi<strong>on</strong> updates an attribute <strong>of</strong> User (in this<br />

case score) inside the database. Depending <strong>on</strong> whether the<br />

user gets the questi<strong>on</strong> right or wr<strong>on</strong>g, their score increases or<br />

decreases by 1 respectively. The get Score() simply returns<br />

the score <strong>of</strong> the User.<br />

Now we need to create a page for answering math<br />

questi<strong>on</strong>s. Create a folder called maths inside the view<br />

folder. Inside that folder create a file index.html.erb.<br />

Put this following code inside the file:<br />

Hello, <strong>Rails</strong>!<br />

The variables rand1 and rand2 which are random numbers<br />

between 0 and 1000, ops is an array c<strong>on</strong>taining the operators<br />

for adding, subtracting, multiplying and dividing and randop<br />

is a random number between 0 and 3 to choose <strong>on</strong>e <strong>of</strong> the<br />

operators.<br />

<br />

<br />

<br />

<br />

The next line simply shows the user what the math<br />

questi<strong>on</strong> is. Then the form begins with the random numbers<br />

and operators in the questi<strong>on</strong>s being put inside r1, r2, and<br />

op to be passed using GET when the user submits.<br />

What is <br />

?<br />

rand1, :r2 => rand2,<br />

:op => randop do %><br />

This code allows the user to submit the form with their<br />

answer inside q.<br />

<br />

<br />

<br />

<br />

Now we check to see if the users answer was correct. If<br />

they answered correctly then we find their id and increase<br />

their score, we also print out their new score. Else their score<br />

will decrease.<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

To get access to this page we need a c<strong>on</strong>troller and to add<br />

a route inside routes.rb to access it.


To create the maths c<strong>on</strong>troller use the command<br />

rails generate c<strong>on</strong>troller maths<br />

This will create a maths c<strong>on</strong>toller.rb file inside<br />

app/c<strong>on</strong>trollers. Navigate to the file and modify it as<br />

follows<br />

Once navigating to the webpage, there should be a login<br />

page displayed. This was all generated by nifty. Initially,<br />

there will be no users in the database. By clicking the<br />

register link, a new account can be created. Once you<br />

created an account youll be automatically logged in. If you<br />

look inside the MySQL Workbench youll see the new user<br />

account added. After creati<strong>on</strong>, that user is now logged in.<br />

There is (obviously) no advanced error checking or loggedin<br />

checking. Additi<strong>on</strong>ally, there is not a link to the math page<br />

created earlier. However, by entering localhost:3000/math,<br />

this page can be viewed. Again, there is no error checking<br />

<strong>on</strong> this page, so navigating to it while not logged in will<br />

cause an error.<br />

First try entering in the right answer, the score should be<br />

displayed with a value <strong>of</strong> 1 which can be checked with the<br />

score inside the database. Now when you test entering in<br />

the wr<strong>on</strong>g answer you should see your score go down by<br />

<strong>on</strong>e when this displayed in the website. Youll also see the<br />

same page in the database. You should be able to tell just<br />

how fast <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> is after this tutorial, since most <strong>of</strong><br />

the code was generated by <strong>Rails</strong>. The <strong>on</strong>ly major piece <strong>of</strong><br />

user written code is the index page for the Maths view.<br />

Once navigating to the webpage, there should be a login<br />

page displayed. This was all generated by nifty. Initially,<br />

there will be no users in the database. By clicking the<br />

register link, a new account can be created. Once you<br />

created an account youll be automatically logged in. If you<br />

look inside the MySQL Workbench youll see the new user<br />

account added. After creati<strong>on</strong>, that user is now logged in.<br />

There is (obviously) no advanced error checking or loggedin<br />

checking. Additi<strong>on</strong>ally, there is not a link to the math page<br />

created earlier. However, by entering localhost:3000/math,<br />

this page can be viewed. Again, there is no error checking<br />

<strong>on</strong> this page, so navigating to it while not logged in will<br />

cause an error.<br />

First try entering in the right answer, the score should be<br />

displayed with a value <strong>of</strong> 1 which can be checked with the<br />

score inside the database. Now when you test entering in<br />

the wr<strong>on</strong>g answer you should see your score go down by<br />

<strong>on</strong>e when this displayed in the website. Youll also see the<br />

same page in the database. You should be able to tell just<br />

how fast <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> is after this tutorial, since most <strong>of</strong><br />

the code was generated by <strong>Rails</strong>. The <strong>on</strong>ly major piece <strong>of</strong><br />

user written code is the index page for the Maths view.<br />

VI. NOTABLE APPLICATIONS<br />

One <strong>of</strong> the most notable applicati<strong>on</strong>s <strong>of</strong> <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong><br />

is Twitter. However due to Twitters explosive growth and<br />

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> problems <strong>of</strong> scalability, Twitter is switching<br />

over to Java (Twitter has now moved its entire search stack<br />

from <str<strong>on</strong>g>Ruby</str<strong>on</strong>g>-<strong>on</strong>-<strong>Rails</strong> to Java. [19]).<br />

While this <strong>on</strong>e example might dissuade new programmers<br />

to use RoR because <strong>of</strong> its problems with scalability it is<br />

still a hotly debated topic. Many senior <strong>Rails</strong> developers<br />

say scalability isnt a problem with RoR (Dix, 2010). They<br />

say that the main problem for scalability is the database. By<br />

dividing up your system into services that access the data<br />

you can distribute the load [20] while using <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong><br />

to hold all the services together.<br />

There are some sites that managed to use Justin.tv while<br />

maintaining high speed. One example is Justin.tv a media<br />

streaming/ VOD website.<br />

There are 5 ways that Justin.tv improved speed while<br />

using <strong>Rails</strong> [21]:<br />

1) SQL - Decreased database querying times by finding<br />

out<br />

• Which queries were slow, indexing queries<br />

• Refactoring slow queries<br />

• Retrieve <strong>on</strong>ly the needed informati<strong>on</strong> from the<br />

database<br />

2) C Libraries<br />

• Speed <strong>of</strong> C<br />

• Better memory management then <str<strong>on</strong>g>Ruby</str<strong>on</strong>g><br />

3) Upgraded MemCache to latest versi<strong>on</strong> - which increased<br />

speeds by a factor <strong>of</strong> 3<br />

4) Cache Expirati<strong>on</strong><br />

• Changed expiry times <strong>of</strong> caches<br />

5) Unicorn<br />

6) GC Tuning<br />

7) Regain Memory<br />

• Less objects allocated<br />

• Removed unused dependencies from Gemfiles<br />

• Removed old c<strong>on</strong>trollers/ views<br />

After these improvements garbage collecti<strong>on</strong> sped up by<br />

10%, resp<strong>on</strong>se time decreased to 80ms, and over 50 thousand<br />

useless objects were saved.<br />

This just shows that while <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> might make<br />

it hard to scale big applicati<strong>on</strong>s reliably, its certainly not<br />

impossible to improvise to improve the speed <strong>of</strong> your<br />

applicati<strong>on</strong>.<br />

According to [22] some other major websites that use<br />

<str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong>- Group<strong>on</strong>, GitHub, Justin.tv, and Hulu.<br />

VII. RUBY ON RAILS COMPARED<br />

In the world <strong>of</strong> web development today, there is a wide<br />

variety <strong>of</strong> languages and frameworks available for use. This<br />

can make deciding what to use for a project more difficult.<br />

The following secti<strong>on</strong> will compare and c<strong>on</strong>trast <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong><br />

<strong>Rails</strong> with more mature languages, as well as more modern,<br />

but less mature, frameworks that are arising in its wake.


A. PHP and Java<br />

While <strong>on</strong> their own PHP and Java do not c<strong>on</strong>stitute a full<br />

stack framework like RoR does, they are both heavily used<br />

within web development due to their inherent flexibility.<br />

PHP and Java both allow, even require, extensive c<strong>on</strong>figurati<strong>on</strong><br />

by the developer. This lends to their flexibility, but<br />

can also be a hinderance due to the amount <strong>of</strong> extra work<br />

required. RoR, however, highly discourages from modifying<br />

any <strong>of</strong> the pre-built c<strong>on</strong>figurati<strong>on</strong>s, promoting learning to<br />

work within those c<strong>on</strong>fines.[23]<br />

Due to RoR’s relative immaturity, it has been criticized<br />

to be not as scalable as PHP and Java. On the other hand,<br />

by having a full stack framework available for use, it goes<br />

without questi<strong>on</strong> that a website can be developed far faster<br />

using RoR, where a single <strong>Rails</strong> developer can do the work<br />

<strong>of</strong> an entire team using Java.[24]<br />

B. Django and Zend<br />

Django and Zend, like RoR, are full-stack frameworks,<br />

designed to be easy to use and implement. The largest<br />

difference between the three is the language that they are<br />

based up<strong>on</strong>. Zend is built <strong>of</strong>f <strong>of</strong> PHP and Django is based<br />

<strong>on</strong> Pyth<strong>on</strong>, unlike <strong>Rails</strong> being built <strong>of</strong>f <strong>of</strong> <str<strong>on</strong>g>Ruby</str<strong>on</strong>g>. Zend, being<br />

based <strong>on</strong> PHP, has held the value <strong>of</strong> flexibility despite the<br />

additi<strong>on</strong>al framework.[25] The Zend framework is utilized<br />

by many high pr<strong>of</strong>ile companies, including Best Buy and<br />

Bank <strong>of</strong> America.<br />

C. .NET MVC<br />

.NET MVC is a very new development framework produced<br />

by Micros<strong>of</strong>t, which was released in 2009. It is based<br />

<strong>of</strong>f <strong>of</strong> the C# language which is very modern, having roots<br />

in both Java and C/C++. Like RoR, it follows the MVC<br />

design pattern.<br />

While core functi<strong>on</strong>ality is very similar between RoR and<br />

.NET MVC, .NET MVC has been found to suffer from a<br />

relative lack <strong>of</strong> community support for both development<br />

support and plugins. This is mostly caused by its young<br />

age.<br />

VIII. CONCLUSION<br />

There are many advantages and disadvantages to using<br />

the <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> framework. Deciding <strong>on</strong> whether or not<br />

to use <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> for an applicati<strong>on</strong> depends <strong>on</strong> the type<br />

<strong>of</strong> qualities the project requires. The initial set up does take<br />

a little more time than some <strong>of</strong> the alternative frameworks.<br />

By dem<strong>on</strong>strating the creati<strong>on</strong> <strong>of</strong> a simple web applicati<strong>on</strong>,<br />

we have hopefully given some insight in to the amount <strong>of</strong><br />

work required to setup and create projects with <strong>Rails</strong>.<br />

REFERENCES<br />

[1] (2012, February) <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> rails. [Online]. Available:<br />

http://ruby<strong>on</strong>rails.org/<br />

[2] (2012, February) <str<strong>on</strong>g>Ruby</str<strong>on</strong>g>. [Online]. Available: http://www.rubylang.org/en/<br />

[3] (2012, February) 37signals: Web-based collaborati<strong>on</strong> apps<br />

for small business. [Online]. Available: http://37signals.com/<br />

[4] M. Slater. (2012, April) Understanding ruby <strong>on</strong> rails. [Online].<br />

Available: http://www.buildingwebapps.com/articles/79188understanding-ruby-<strong>on</strong>-rails<br />

[5] (2012, February) <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> rails guides: Getting<br />

started with rails. [Online]. Available:<br />

http://guides.ruby<strong>on</strong>rails.org/getting started.html<br />

[6] R. Fielding. (2012, February) Architectural styles<br />

and the design <strong>of</strong> network-based s<strong>of</strong>tware architectures.<br />

[Online]. Available: http://www.ics.uci.edu/ fielding/pubs/dissertati<strong>on</strong>/top.htm<br />

[7] R. <strong>on</strong> <strong>Rails</strong> Team. (2012, February) <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> rails. [Online].<br />

Available: http://ruby<strong>on</strong>rails.org/<br />

[8] ——. (2012, April) <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> rails documentati<strong>on</strong>. [Online].<br />

Available: http://api.ruby<strong>on</strong>rails.org/<br />

[9] ——. (2012, 04) <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> rails guides:<br />

Getting started with rails. [Online]. Available:<br />

http://guides.ruby<strong>on</strong>rails.org/getting started.html<br />

[10] T. Fisher, <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> R○ Bible, 1st ed. Wiley Publishing<br />

Inc., October 2008, no. 67-74, 107-109, 147-149, 173-179.<br />

[11] R. <strong>on</strong> <strong>Rails</strong> Team. (2012, February) <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> rails: Deploy.<br />

[Online]. Available: http://ruby<strong>on</strong>rails.org/deploy<br />

[12] (2012, April) Rfc 1866 - hypertext markup language - 2.0.<br />

[Online]. Available: http://tools.ietf.org/html/rfc1866<br />

[13] T. Reenskaug. (2012, February) Trygve/mvc. [Online].<br />

Available: http://heim.ifi.uio.no/ trygver/themes/mvc/mvcindex.html<br />

[14] M. Fowler. (2012, April) P <strong>of</strong><br />

eaa: Active record. [Online]. Available:<br />

http://www.martinfowler.com/eaaCatalog/activeRecord.html<br />

[15] Hibernate. (2012, April) What is object/relati<strong>on</strong>al<br />

mapping? - jboss community. [Online]. Available:<br />

http://www.hibernate.org/about/orm<br />

[16] R. P. L. Team. (2012, February) <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> programming<br />

language. [Online]. Available: http://www.ruby-lang.org/en/<br />

[17] Y. Santoso. (2012, April) Gnome’s<br />

guide to webrick. [Online]. Available:<br />

http://microjet.ath.cx/webrickguide/html/html webrick.html<br />

[18] Phusi<strong>on</strong>. (2012, April) Overview – phusi<strong>on</strong> passenger( TM )<br />

(a.k.a mod rails / mod rack). [Online]. Available:<br />

http://www.modrails.com/<br />

[19] A. Williams. (2012, April) Once again, twitter<br />

drops ruby for java. [Online]. Available:http://www.readwriteweb.com/cloud/2011/04/twitterdrops-ruby-for-java.php<br />

[20] P. Dix, Service-Oriented Design with <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong>.<br />

Addis<strong>on</strong>-Wesley Pr<strong>of</strong>essi<strong>on</strong>al, 2010.


[21] (2012, April). [Online]. Available:<br />

http://www.slideshare.net/kwi/rails-performance-at-justintvguillaume-luccisano<br />

[22] Stuart. (2012, April) Top 50 ruby <strong>on</strong> rails websites.<br />

[Online]. Available: http://storecrowd.com/blog/top-50-ruby<strong>on</strong>-rails-websites/<br />

[23] B. A. Tate and C. Hibbs, <str<strong>on</strong>g>Ruby</str<strong>on</strong>g> <strong>on</strong> <strong>Rails</strong> Up and Running.<br />

O’Reilly Media, Inc., August 2006, no. 2.<br />

[24] D. Geer, “Will s<strong>of</strong>tware developers ride ruby <strong>on</strong> rails to<br />

success,” Computer, vol. 39, no. 2, p. 19, February 2006.<br />

[25] R. Allen, N. Lo, and S. Brown, Zend Framework in Acti<strong>on</strong>.<br />

Manning Publicati<strong>on</strong>s, January 2009, no. 15.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!