How To Code A Ruby on Rails Web Application

Ruby on Rails is a web application framework.

Rails is the framework, Ruby is the language.

Designed by David Heinemeier Hansson in 2005, it’s become renowned in the Internet startup world for its adoption by some of the leading “startups” of our time, including Stripe, Uber and Groupon.

If you want to learn to program in Ruby on Rails, this tutorial should give you an overview of what to do. I won’t go into specifics because I just want to give you an idea as to the structure of an application. If you follow what I propose, you should more fully understand how these applications work.

Web Applications

All software applications work in the same way –

Data is inputted
Data is processed
Data is outputted
The way the data is inputted and processed is dependent on the platform your application runs on. How it is outputted depends on your application.
The difference with web applications is that their logic runs on a server, with the data IO being passed through the Internet (specifically, the HTTP protocol).

The complication of web apps is that you require the ability to accept inbound data, and return responses. This is handled by a web server program (NGinx or Apache). I’ll explain this in a minute.

Software Stack

When you create a piece of software, you have to consider the “stack” on which it runs.

The “stack” is all the software required to run your application. In the world of desktop games, for example, the “stack” may include the likes of DirectX or a particular graphics driver.

The main hold-back for would-be web application developers is understanding how the “web” software stack works. Web works similarly to native applications, except for one distinct difference – stateless.

The “Internet” operates under the HTTP protocol. By nature, this is known as a “stateless” protocol – each request you send is considered independent to the last. Unlike stateful protocols (which retain state), stateless protocols have to rebuild the application’s state each time.

Whilst this means nothing to most people, the point is that if you’re going to develop a web based application, you need to use a framework or technology set which makes the stateless nature of HTTP as integrated as possible. Most pertinently, you need an authentication system which rebuilds the user’s session on every request (I’ll explain this in a second).

Leave a Reply

Your email address will not be published. Required fields are marked *