Category: 5. Ruby on Rails
-
Ruby on Rails MVC
Like most of the other frameworks, Rails is also based on MVC pattern. It basically works as following: Requests first come to the controller, controller finds an appropriate view and interacts with model which in turn interacts with database and send response to controller. Then controller gives the output to the view based on the…
-
Active Record
Data structures are represented by a hierarchy of classes. Data is mostly stored in relational database tables. There is an essential mismatch between your program’s object view and database’s relational data view. To remove this mismatch, many attempts have been tried. One way to resolve this mismatch was through the use of Object-relational-mapping (ORM) tools.…
-
Ruby on Rails Directory Structure
On creating a Rails application, the entire Rails directory structure is created. We will explain Rails 5 directory structure here. The jtp directory (shown below) has a number of auto-generated files and folders that comprises the structure of Rails application. We will explain the function of each of the files and folders present in the above directory.…
-
Ruby on Rails 5 Hello World Example
Prerequisites Text Editor: You can use any text editor which is suitable for you. We are using Sublime Text editor which features many plugins. Browser: We are using Ubuntu default browser, Mozilla Firefox. Hello World Example Step 1 Create a directory jtp in which all the code will be present and will navigate from the command line. Step 2 Change the…
-
Rails Scripts
Rails provides us some excellent tools that are used to develop Rails application. These tools are packaged as scripts from command line. Following are the most useful Rails scripts used in Rails application: Rails Console The Rails console is as command line utility which runs Rails application from the command line. The Rails console is…
-
Rails IDE or Editor
Ruby on Rails can be used with either a simple text editor or with an IDE. A text editor is a tool that creates and edits a file with only plain text. Once the code is written in the editor, it need to be compiled and run on a command line tool. An IDE stands…
-
Ruby on Rails Installation
We will set up Ruby on Rails in Ubuntu 14.04 operating system. There are three methods to install Ruby: We will install using rbenv as it is the most recommended way. First we will install some dependencies for Ruby: Install rbenv Installing rbenv is a simple two way process. First rbenv will be installed and…
-
Ruby on Rails Features
Rails 5 was launched on 18th September 2015 by David Heinemeier Hansson in Atlanta. Some new features were implemented in Rails 5 version. Some features are listed below: Symbol Garbage Collector Passing symbols opens the possibility of several attacks in your system. The symbol garbage collector collects the symbols which prevents your system from several attacks.…
-
Ruby on Rails Introduction
Ruby on Rails is a server-side web application development framework written in Ruby language by David Heinemeier Hansson. It allows you to write less code than other languages and frameworks. It includes everything needed to create database-backed web applications according to MVC pattern. It is opinionated software. There are two major guiding principles: Ruby on…