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
To install Rails, you need to have the Ruby programming language and the Rubygems library manager installed. Once the two dependencies have been installed, it is as easy as running this command:
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.
– 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.
Banco Bilbao Vizcaya Argentaria, S.A. owner of this portal uses cookies and/or similar technologies of its own and third parties for the purposes of personalization, analytics, behavioral advertising or advertising related to your preferences based on a profile prepared from your browsing habits (e.g. pages visited). If you wish to obtain more detailed information, consult our Cookies Policy.
Cookie settings panel
These are the advanced settings for first-party and third-party cookies. Here you can change the parameters that will affect your browsing experience on this website.
Technical Cookies (required)
These cookies are used to give you secure access to areas with personal information and to identify you when you log in.
Name
Owner
Duration
Description
gobp.lang
BBVA
1 month
Language preference
aceptarCookies
BBVA
1 year
Configuration Accepted Cookies
_abck
BBVA
1 year
Helps protect against malicious website attacks
bm_sz
BBVA
4 hours
Helps protect against malicious website attacks
ADRUM_BTs
Salesforce Marketing Cloud
Session
Required for monitoring of the service, inherent to SFMC
ADRUM_BT1
Salesforce Marketing Cloud
Session
Required for monitoring of the service, inherent to SFMC
ADRUM_BTa
Salesforce Marketing Cloud
Session
Required for monitoring of the service, inherent to SFMC
ADRUM_BT
Salesforce Marketing Cloud
Session
Required for monitoring of the service, inherent to SFMC
xt_0d95e
Salesforce Marketing Cloud
Session
Remember user preferences (if any)
__s9744cdb192d044faa1bf201d29fafd1e
Salesforce Marketing Cloud
Session
Remember user preferences (if any)
wpml_browser_redirect_test
WPML
Session
Text translation in the portal
wp-wpml_current_language
WPML
24 hours
Text translation in the portal
Analytics Cookies
They are used to track the activity or number of visits anonymously. Thanks to them we can constantly improve your browsing experience
Your browsing experience is constantly improving.
With your selection, we cannot offer you a continuously improved browsing experience.
Name
Owner
Duration
Description
AMCV_***
Adobe Analytics
Session
Unique Visitor IDs used in Cloud Marketing solutions
AMCVS_***
Adobe Analytics
2 years
Unique Visitor IDs used in Cloud Marketing solutions
demdex (safari)
Adobe Analytics
180 days
Create and store unique and persistent identifiers
sessionID
Adobe Analytics
Session
Launch's internal cookie used to identify the user
gpv_URL
Adobe Analytics
Session
Adobe Analytics plugin: getPreviousValue Capture the value of a certain variable in the following page view, in this case the prop1
gpv_level1
Adobe Analytics
Session
Cookie used to store the DataLayer levl1 of the previous page.
gpv_pageIntent
Adobe Analytics
Session
Cookie used to store the pageIntent of the previous page.
gpv_pageName
Adobe Analytics
Session
Cookie used to store the pagename of the previous page.
aocs
Adobe Analytics
Session
Cookie that stores the first values collected at the beginning of a process.
TTC
Adobe Analytics
Session
Cookie used to store the time between the App Page Visit event and the App Completed event.
TTCL
Adobe Analytics
Session
Cookie used to store the time between the LogIn event and App Completed.
s_cc
Adobe Analytics
Session
Determine if cookies are active
s_hc
Adobe Analytics
Session
Cookie used by Adobe for analytical purposes
s_ht
Adobe Analytics
Session
Cookie used by Adobe for analytical purposes
s_nr
Adobe Analytics
2 years
Determine the number of user visits
s_ppv
Adobe Analytics
Permanent
Adobe Analytics plugin: getPercentPageViewed Determine what percentage of the page a user views
s_sq
Adobe Analytics
Session
ClickMap/ActivityMap features
s_tp
Adobe Analytics
Session
Cookie used by Adobe for analytical purposes
s_visit
Adobe Analytics
2 years
Cookie used by Adobe to know when a session has been started.
Advertising Cookies
They allow the advertising shown to you to be customized and relevant to you. Thanks to these cookies, you will not see ads that you are not interested in.
The advertising is customized to you and your preferences.
Your choice means you will not see customized ads, only generic ones.
Name
Owner
Duration
Description
OT2
VersaTag
90 days
VersaTag Cookie used to store a user id and the number of user visits.
u2
VersaTag
90 days
VersaTag Cookie where the user ID is stored
TargetingInfo 2
MediaMind
1 year
Cookie that serves to assign a unique random number that generates MediaMind.
Customization Cookies
These cookies are related to general features such as the browser you use.
Your experience and content have been customized.
With your selection, we cannot offer you a continuously improved browsing experience.
Name
Owner
Duration
Description
mbox
Adobe Target
9 days
Cookie used by Adobe Target to test user experience customization.
Looks like you’re browsing from MexicoSpainArgentinaPeruColombiaBelgiumChileUSAFranceHong KongItalyPortugalUnited KingdomTurkeyUruguayVenezuelaAlemania, so let’s show you the custom content for your
location. Change
Select a country
In order to access the private area and corresponding sandbox, select the country of the APIs you want to use.