image description
« Back to blog

Using Ruby on Rails When Developing Software

Before getting into the material, it is important to clarify that Ruby and Ruby on Rails are not the same. Ruby is a programming language started in 1993 by Yukihiro Matsumoto. It was created through combining other languages like Java and C++. It is flexible and precise, which makes it capable of efficiently organizing written code. Its syntax is founded on code blocks that help eliminate errors when changing lines of instruction. However, Ruby did not jump to international fame until 2008, 15 years after its founding. This was five years after it was combined with a framework called Rails. This combination this framework the name Ruby on Rails (RoR). This was created by David Heinemeier Hasson in 2003 and has become very popular amidst programmers in recent years because of its simplicity and foundation in agile methodologies.

Rails extends the language Ruby in the same way that .NET, Spring, or Django extend C#, Java, or Python, respectively..

Ruby and Ruby on Rails are both a software that one can download and install for free. Here you can download Ruby, and here you can download RoR. There is also a vast number of practical guides to configure and start them up. Also on their website are videos, courses (just as much face-to-face as they are online), tutorials, books, etc. about Ruby on Rails and its use in developing software.

At DIGITAL55 we also wanted to offer users a simple, practical guide about how to install Ruby on Rails and deploy it with Capistrano.

 

Ruby on Rails: its principles and the MVC pattern

Ruby on Rails is a framework founded in the pattern of Model-View-Controller, or MVC. This strategy helps to organize different functional parts of developed software to create a single finalized use. The objective of these divisions is so that a change in one part does not cause harm to another part.

One important thought to keep in mind: although the app in total will have multiple uses, each individual part of the code should only have one responsibility.

But, how does the MVC pattern work? When the makes a software request, the controller responds to this. Then, the controller asks the model for all of the related information such as images, text, video, et cetera. The model then looks in the database and sends information to the controller. Finally, with the received information, he sends it to the view, who requests that it be organized and constructed all the while preserving the author’s established style.

Ruby on Rails is founded on two main principles:

1.- Don’t repeat yourself (DRY). This principle tells coders not to do double work.

2.- Standards before configuration: : Generators create a directory tree that organizes the project’s structure. The developers, through the archive’s configuration, will be able to specify the necessary parameters for its correct use. This uses a model called “User,” which will be automatically related with the “users” table from the database. However, if this does not follow the standards, it should be specified in a manual form as follows: set_table_name “users_admin.” “Thus, when designing an application starting from scratch without a preexisting database, following Rail’s standards means using less code.”

3.- Finally, there is a slogan that developers use. Although it is not necessarily a principle, it should be noted as one: “Test all the f*cking time” (TATFT). This slogan utilizes the Test Driven Development (TDD) strategy. This is based on writing tests before starting to write the actual functionalities of the system.

 

Open Source Bookstores or Gems

The Ruby on Rails bookstores, commonly known as gems because of their connection with Ruby, help solve programming problems and make work easier for developers. A large amount of these gems can be downloaded and installed for free. Although they all enormously facilitate software development in distinct ways, six stand out above the rest:

image description
  • Bundler: Probably developers’ most valued gem. With it, one can automatically install all of the other gems to develop software from a file called gemfile.
  • Devise: This gem makes introduction to an authentication system on any app possible.
  • Omniauth: Although it is very similar to the prior app, this one differentiates itself because the implemented authentication system’s purpose is to connect social networks like Twitter or Facebook.
  • Paperclip: A frequently used gem with projects that have a heavy visual burden. To a large extent it facilitates the integration of images in development. It also makes the modification of format and size possible, amongst other uses.
  • Kaminari: This is used to divide parts of a page to make them visually pleasing. It also offers the possibility to apply distinct templates catered to the preferences or needs of the client.
  • FriendlyID: Helps to create friendly URLs. It is very necessary for projects that hope to make maximum use of SEO positioning.

 

Big Apps Developed through Ruby on Rails

  • Twitter: Although since 2011 it has used Java, one of the world’s most famous social networks was first made with Ruby on Rails by a team of two people.
  • Kickstarter e IndieGoGo: The two biggest crowdfunding apps use this framework.
  • Soundcloud: Just like twitter, the leader in free podcasts and music, which receives 175 million visits every month, developed its application with RoR. Although later they changed to the language Scala, the app maintains parts with Ruby code.
  • Twitch: Ruby on Rails is also present on the most used videogame streaming platform’s app.
  • Groupon: The web’s leader in offers and coupons also uses an application developed by Ruby on Rails. It has over 35 million registered users.

 

Advantages of Ruby on Rails

  • Ruby on Rails is a framework that greatly increases productivity since it is built from agile methodologies. A lot of developers call it the “agile framework for excellence.”
  • As was said earlier, RoR utilizes the Model-View-Controller framework. Because the development can be divided, the project’s scalability is simplified, which enormously benefits the developers and helps save resources.
  • Thanks to efficient code use, Ruby on Rails is a framework that favors a dynamic app development.

Ruby on Rails continues to be one of software developers’ favorite frameworks. Its simplicity over other languages and advantages over other approaches has helped it maintain its position for years as one of the most used frameworks in app development.

 

DIGITAL55 and Ruby on Rails

At DIGITAL55 we have developed projects for large companies with this framework. Some that stand out:

  • Altadis: A digital platform for organizing sales forces.
  • Acciona: Software for controlling and managing I+D+I funding in the European Union.
  • Hospes: An app to improve a client’s experience in the luxurious hotel chain Hospes.
  • Madrid Local Government: An infrastructure for the participatory budget platform and online agendas for the city councillor.