Ruby on Rails
Ruby on Rails (often shortened to RoR or simply Rails) is an open-source framework for building web applications, written in the Ruby language. Created in 2004 by David Heinemeier Hansson, it popularized an approach in which the developer focuses on business logic while the framework supplies a ready-made application skeleton, a database layer and routing.
How Ruby on Rails works
Rails rests on two principles that define its character. The first is convention over configuration: if you follow the expected naming and directory structure, the framework infers how to connect a model to its database table or a controller to its view — without writing sprawling configuration files. The second is DRY (Don't Repeat Yourself), the avoidance of duplicated code. Architecturally, Rails implements the MVC (Model–View–Controller) pattern, separating data, logic and presentation.
The heart of the data layer is Active Record, an ORM that maps Ruby objects to database rows, most often in PostgreSQL or MySQL. Functionality is extended through gems — ready-made libraries installed with the Bundler manager. Rails also streamlines building REST-compliant APIs, making it a solid backend for SPA and mobile applications.
Practical application
GitHub, Shopify, Basecamp and the early versions of many well-known startups were built on Rails — no coincidence, since the framework is famous for turning an idea into a working MVP fast. Code generators scaffold a CRUD admin panel in minutes, and built-in migrations keep database schema changes orderly. Rails applications run on application servers such as Puma, typically behind an Nginx reverse proxy. Deployment needs an environment with a Ruby interpreter, a database and a process manager, which is why Rails feels at home on a VPS that gives full control over the configuration.
Powiązane pojęcia
Najczęstsze pytania
What kind of projects is Ruby on Rails good for?
Rails excels at CRUD applications, admin panels, MVPs and startups where getting a working product out fast matters most. Its conventions and rich gem ecosystem let a small team build a full application quickly. It is a less natural fit for services that demand extreme computational performance.
