BBVA API Market
Simple, agile, perfect for worrying about only what matters, adequate data management… These are some of the concepts that crop up when we talk about Ruby on Rails (RoR), one of the back-end frameworks for open source development that is best known and recognized within the developer community. This is intended as a quick guide to start using and developing it with all kinds of web applications.
The first step to start creating projects with RoR is to know how to code in Ruby, an accessible programming language similar to Python, interesting to create simple and flexible applications, with a large number of libraries, but with slightly lower performance than C or C++. Today it is a relatively modern syntax, which have become fashionable.
The general characteristics of this development framework:
– RoR is a framework based on agile methodologies. It is a perfect example of how a framework improves productivity. In fact, Ruby on Rails could be defined as the agile par excellence framework.
– This development framework is easy to learn. You must have some knowledge of PHP to manage Ruby on Rails. If you have mastered that language, which is widely used for all kinds of digital projects, learning this tool becomes child’s play.
– Ruby on Rails operates under a MVC (Model-View-Controller) paradigm. This paradigm allows you to separate the design logic from the business logic and facilitates scalability of developments. In addition, this enables the development team to properly maintain the code without spending excessive resources.
– It enables rapid development of web applications. Economic use of the code for programming projects. Less is more.
– Automatic creation of database and forms. The relationships between different data models are configured from the macros that come by default in Ruby on Rails, which greatly facilitates development work with relational databases such as MySQL, for example. In any case, RoR provides a tool called ActiveRecord, which allows access to the database without executing SQL code. ActiveRecord provides a methodology to search databases by using tables. It is a way of saving traditional SQL queries by using a protocol called joins.
– It has many libraries that make the task of configuring the actual development framework easier. This allows the developer to focus more on the needs of the application.
– As an MVC development framework, Ruby on Rails is a tool that properly controls server resources. This prevents errors that end up adversely affecting project performance.
First step with Ruby on Rails: installation
gem install rails
A tool that can help any developer to manage the updated versions of the language, the framework and the library manager is Ruby Version Manager (RVM), a command-line tool to install, manage and work with different environments (versions) of Ruby at once. A number of important steps are required to install RVM:
– Open the console.
– Access the context menu by right clicking.
– Choose the option Profiles/Profile Preferences.
– Go to the tab ‘Title and Command’ and check that the option ‘Run – the command as a login shell’ is enabled.
– Installation of the operating system packages orders through Ruby Version Manager. To do this you must run the following command lines: sudo apt-get install -and git-core subversion
– Configuring the signature.
– At the end, rapid installation of RVM. To do this, use the following command: \curl -sSL https://get.rvm.io | bash -s stable –rails –ruby
RVM is not the only alternative for the installation of the development framework. There is also another manager to manage different versions of Ruby and separate environments for each development. An example is rbenv. Installation requires cloning the repository in GitHub or opening a console and running the line of code apt-get install git if the developer has Ubuntu.
The download of the latest versions of Rails is always accompanied with the installation of an additional suite of tools to help the development of digital projects with this framework: besides the Ruby language, we have Bundler, possibly the most important gem (library) in Ruby because it allows all the gems that will be used in an application to be defined and automatically installed from a gemfile file; Git, a control system of open source versions; SQL Server Support; and MySQLite, a library for manipulating SQLite database systems. Installation only requires the terms and conditions to be accepted to the end.
The world of gems: installation and examples
The installation of Rubygems is very simple, it only has three steps:
– Download the file in any format: .zip, .tgz, .gem o bien available within the GitHub collective repository. If you already have an earlier version, you can seamlessly upgrade by running the command $ gem update –system. You must be a system administrator to make Rubygems updates.
– Unzip the directory.
– Final installation of the library manager with the command ruby setup.rb. As in the first step, you need to be an administrator.
– Devise. This is used to introduce an authentication system in any web application. This is one of the gems that has been best received by the community.
– Omniauth. This Ruby on Rails gem allows you to introduce a login system, but through networks like Facebook or Twitter.
– Kaminari. This gem, developed by Akira Matsuda, enables paging objects easily and visually. It also has the possibility of applying different templates to change the default page type. Here its repository in GitHub.
– Paperclip. A very interesting gem for digital developments because it facilitates easily adding images, with the ability to change key elements in these files such as a format or size.
– FriendlyId. This facilitates building friendly urls, an important element for organic positioning in publishing projects.
Follow us on @BBVAAPIMarket
You no longer need to go to a bank branch to open a bank account. APIs allow you to complete this and any other banking operations without leaving your company's own platform, with a fully integrated experience.
The real estate sector is becoming digitized by investing in technological solutions to adapt to a user looking for simple processes and transparent documentation in the purchasing processes.
Checkout financing is a digital alternative to credit cards that boasts advantages such as flexibility, creating one credit facility per customer and ensuring their future loyalty, thus improving the customer lifetime value.