Ruby on Rails is an application framework for Web development which is written in Ruby, it is a dynamically written programming language just like Python, Smalltalk, and perl. It is often referred as RoR. It is an Open source for ruby language
Rails uses MVC Framework. MVC is Model-View-Controller architecture which organizes the application programming. It makes several tasks easier. It provides scaffolding which is useful in constructing some of the models and views automatically, which are needed for basic websites. It highly relies on Web server to get executed
Structure:
Ruby on Rails is separated into various different packages viz ActiveRecord (It is an Object Oriented mapping system), ActionPack, ActiveSupport and ActionMailer
RoR si designed to mainly focus on Convention over Configuration (CoC), and the rapid development of Don’t Repeat yourself (DRY). CoC reduces the developers work, developer only needs to specify the aspects which are not conventional. DRY states that the information located at a single and unambiguous place.
Lets see the basis of the Ruby on Rails. RoR is based on the MVC Architecture.
MVC organizes the code to mask the complexity. It separates the web application into three sections
The Model
The Controller:
The View:
The Model: It is responsible to take care of the database interactions. It abstracts the database objects in your applications. This section also handles the ‘data integrity’ issue in the databases.
The controller: It is an intermediate between model and View. It handles the interaction of the Server. It fetches the objects from the database using the model and it hands them over to the View. It has a direct access to the Web Server, Cookies and session variable.
The View: It generates the HTML code that is displayed in the browser. It takes the data from the Controller and produces the HTML equivalent for the same. The formatting and styling is handles by the view. View is combination of Ruby code and HTML.
Ruby on Rail works on all this concepts and integrates them to a single pack which is used by the web developers. Every component of the MVC is implemented by the Rails