ruby on rails

Standard Components of the RoR Framework

As a web application framework, Ruby on Rails already provides all the components you need to program a feature-rich application in the standard configuration. The only additional prerequisites are that Ruby, the RubyGems package manager, and the SQL database are installed. As for the last element, the Rails team recommends SQLite, the open source library written in C, which contains a relational database. These are the standard modules of the Ruby on Rails framework:

  • Action Controller: With the help of the Action Controller module you create the mentioned contact points between the database data, the users who access it and the programs.
  • Action View: Action View offers you the ability to create views for individual data and controllers. As far as naming is concerned, by convention all views must be recognized by the respective controller.
  • Active Record: This is a central database manipulation module of your Rails application. To create the individual templates with its help, the configuration work required is minimal, if you adhere to the naming and schematic conventions. Ruby on Rails offers for this purpose with the help of the scaffolding procedure (literally scaffolding) the optimal tool to create interfaces for the four CRUD operations, which present the updated data on the object-oriented layer.
  • Active Resource: This module implements Object Relational Mapping (ORM) for REST services. Like Active Record it also focuses on these components to save on configuration.
  • Action Mailer: Action Mailer allows you to send and receive emails with your application. This way, you can easily configure e-mail registration and login.
  • Active Support: The Active Support module contains several useful classes of standard utility programs and library extensions.
  • Railties: In order for all components of the RoR framework to work together, there are so-called railties. For this reason, each module has implemented its own railtie to start, for example, the initialization process or to be able to make changes to the framework settings. Also railties are needed to add some modules to Ruby on Rails.

Ruby on Rails: Advantages and Disadvantages of the Framework

When we talk about Ruby on Rails, we often refer to this story:

Two developers discuss the different programming languages. The first says: “I work with Java, PHP is used by my children to play.” And the second replies: “I play with my children and I make Ruby work for me!”.
Of course, behind this story there is a good dose of exaggeration, but also a grain of truth. Java is suitable for creating complex sites of excellent quality, in fact it is often used as a framework in e-commerce. Programming with a multi-platform language, however, is often far from simple due to its complex structure and, as a rule, requires a lot of effort and time. Even Ruby, as an interpreted scripting language, is not tied to any specific platform but, at the same time, it writes much faster, is more easily customizable and much lighter. But the speed of applications developed with Ruby on Rails is slower than similar ones built in JavaScript.

Even PHP, when compared to Java, has clear advantages in terms of simplicity and the commitment required in development. It is no coincidence that PHP has established itself as a standard solution, which among other things forms the basis of various CMSs such as WordPress, TYPO3 and Joomla. Taking into account the fact that PHP was arbitrarily composed and was not always object-oriented, upgrades of web applications, which were developed with previous versions, become more laborious. From the beginning Ruby on Rails was entirely programmed object-oriented, so applications, which are programmed with the help of older versions, usually contain cleaner code than similar PHP projects.

Ruby on Rails contains an integrated framework, with the help of which you can test the operation of your application at any time, identifying and fixing errors from the beginning. The web 2.0 techniques such as AJAX can be used only by inserting a few lines. Furthermore, Ruby and the Rails framework enjoy an ever larger and growing community, as evidenced by the greater choice of extensions.

Rails’ innovative philosophy of pursuing as much simplification as possible for the developer, which Matsumoto has sought from the start with features such as scaffolding, established conventions or the MVC structure, also serves as a model for many other new frameworks. Thus the approach is found among other things in the PHP frameworks Symfony, CakePHP and Zend.

ruby benefits

Who is the Ruby Framework Suitable for?

Ruby on Rails offers everything a developer needs for building a modern web app: quality architectures to build the interface, an easy connection to configure and connect to the SQL database, and the ability to configure web technologies such as AJAX. The clear principles “Don’t repeat yourself” and “Convetion over configuration” offer the basis for programming a clean code, easily understandable and customizable in the best way, which is also written quickly. But some configurations are possible without problems because Ruby offers all the freedoms a programmer needs. So the framework is suitable for both beginners and even experienced programmers who have worked with other scripting languages ​​up to that point, although in both cases a certain amount of time should be taken into account to learn how to use it.

Thanks to the scaffolding system, prototypes of planned websites are created in a very short time: this is clearly one of the major strengths of the Ruby framework. Thanks to the integrated test environment, check that your applications do not contain possible errors already during the development phase. Ruby on Rails also proves to be prepared for complex applications. With the help of extensions, called RubyGems, which also include the framework itself, you can easily add the necessary interfaces, libraries or functional and graphic features. Since Ruby and the RoR framework are under the free BSD license, the only resulting costs are those of hosting the website.

But you shouldn’t assume that you don’t need any programming knowledge for Ruby on Rails. Of course, unlike the developer story above, the scripting language doesn’t take care of everything. In terms of speed, applications developed with RoR cannot completely keep up with the competition. The code only runs when the user accesses the content, because processing of incoming requests obviously takes a little longer than precompiled lines of code.

Also you have to do without the Rails framework, if you want to manage your applications with CMS like Drupal, Joomla or WordPress. The examples cited are based, as well as other platforms, on PHP. But there are already CMS based on Ruby on Rails, such as Alchemy CMS. It’s hard to imagine RoR spreading to the point where the status of the PHP, Java and Python market leaders is challenged. In any case, the advantages and growing popularity of the Ruby framework are undeniable.