Introduction
David Heinemeier Hansson developed ruby on Rails under the MIT license. It uses Model View Controller(MVC) architecture, providing a structure for databases, web pages and web services. JSON(Javascript Object Notation) and XML(Extensible Markup Language) structures are used to transfer data from front to back and vice versa. Rails was designed to give the developer a more productive environment.
Suppose we need to take and maintain a database in our application. Rails is just another alternative for it.
Prerequisites
General understanding of Object-oriented programming is a must, along with basic knowledge of web development.
Why ruby on rails?
Ruby on rails is time-efficient as it greatly increases the productivity of a developer and it has a larger community. The codebase is easy to maintain. Rails provide a number of tools and libraries. All this increases the performance of the codebase. Rails is generally used in large projects that are to be scaled and is more time taking. More points can be considered as discussed below:
- Being a full-stack framework, it has everything we need to build any database-related web application
- We can access its code as it is open source.
- Ruby as a language is easy to learn, has a large community of developers, is object-oriented and has a very extensive library.
- Rails provide testing features and have libraries that one can extend to customize the test cases using fixtures and harnesses. Automated tests can then be executed using the rake utility.
- Rails provide development, production and test environment which helps in development processes. For example, rails create a fresh temporary database every time the test is executed.
Features
- Convention over configuration: In rails, one can modify the general conventions of the application giving more flexibility to the programmer.
- Metaprogramming: Rails supports metaprogramming in which one can modify classes and functions at runtime.
- Active records: Rails provide active records which are handling data over in the application. It enables interaction of the database layer with the view.