Generated by GPT-5-mini| Rails (web framework) | |
|---|---|
| Name | Rails |
| Developer | David Heinemeier Hansson; Basecamp (company); Harvard University alumni community |
| Initial release | 2004 |
| Latest release | 7.x |
| Written in | Ruby (programming language) |
| Operating system | Cross-platform |
| Genre | Web application framework |
| License | MIT License |
Rails (web framework) Rails is an open-source web application framework written in Ruby (programming language), created by David Heinemeier Hansson during his work at Basecamp (company). Influenced by prior frameworks and architectures used at 37signals and by concepts from Model–View–Controller implementations such as Smalltalk, Rails emphasizes convention over configuration and rapid application development. Rails' design and community have intersected with projects and organizations including GitHub, Heroku, Amazon Web Services, Google Cloud Platform, and academic work from Massachusetts Institute of Technology and Stanford University.
Rails emerged in 2004 when David Heinemeier Hansson extracted framework components from the Basecamp (company) project while contributing to the 37signals product line. Early influences included Smalltalk MVC patterns, Ruby on Rails (book) authorship, and web frameworks like Django and Struts (framework). The initial public release and advocacy through conferences such as RailsConf and Yahoo! developer talks accelerated adoption among startups like Groupon, Shopify, and Airbnb (company). Over time, stewardship shifted through community governance, contributions from organizations like Engine Yard, Phusion, and corporate adopters including Twitter and SoundCloud.
Rails implements a layered architecture drawing from the Model–View–Controller paradigm. Core components include the ActiveRecord (Rails) ORM, the Action Pack stack (comprising Action Controller and Action View), and middleware based on Rack (software). Integration points tie into web servers such as Puma (web server), Unicorn (HTTP server), and Passenger (software), and into runtime managers like RVM and rbenv. Additional subsystems or engines—mirrored in plugins and gems—connect to services like Redis, Sidekiq, PostgreSQL, MySQL, and cloud providers such as Amazon Web Services and Google Cloud Platform.
Routing in Rails maps HTTP verbs and URL patterns to controller actions using a declarative DSL influenced by RESTful (computer science) principles and practices codified in sources like Roy Fielding's work on Representational State Transfer. Controllers orchestrate requests, invoking models and rendering views through templating systems such as ERB and alternatives implemented by contributors associated with Haml and Slim (templating language). The MVC pattern in Rails interacts with HTTP specifications advanced by organizations like IETF and with testing frameworks maintained by communities around RSpec and Minitest.
ActiveRecord provides an object-relational mapping layer that encapsulates SQL interactions for databases including PostgreSQL, MySQL, SQLite, and adapters for proprietary engines supported by vendors like Oracle Corporation. Features include migrations inspired by schema management practices from Liquibase and Flyway (software), validations influenced by patterns described in Martin Fowler's writings, and query interfaces that integrate with database tuning tools from PgBouncer and Percona. The ecosystem includes ORMs and persistence alternatives such as Sequel (library) and NoSQL connectors for MongoDB and Cassandra.
Rails incorporates security measures addressing threats cataloged by projects like OWASP and standards set by agencies such as NIST. Built-in protections include CSRF tokens, parameter filtering, strong parameters, and escaping strategies for XSS mitigation—practices promoted at events like Black Hat and in advisories by CERT Coordination Center. Performance considerations drive integration with caching and delivery systems like Varnish, Memcached, Redis, content delivery networks operated by Cloudflare and Akamai Technologies, and monitoring tools from New Relic and Datadog. High-scale deployments and case studies from companies like GitHub and Shopify inform best practices for concurrency, background processing, and horizontal scaling.
Rails relies heavily on the RubyGems packaging system and a large ecosystem of gems developed by individuals and organizations including thoughtbot, Shopify, GitHub, and community contributors from Stack Overflow. Official tooling includes the Rails command-line interface, generators, the asset pipeline inspired by frontend workflows from Sprockets and standards from the W3C, and integration with JavaScript toolchains like Webpack and ESBuild. Developer productivity is supported by IDEs and editors such as RubyMine, Visual Studio Code, and Sublime Text, while CI/CD integrations are common with platforms including Travis CI, CircleCI, Jenkins, and GitLab CI.
Rails achieved rapid adoption among startups and enterprises, powering platforms like Basecamp (company), GitHub, Shopify, Groupon, and many educational projects at institutions like Harvard University and Yale University. Critics have raised concerns about runtime performance compared to frameworks in Java (programming language), Go (programming language), and Node.js, and about complexity introduced by metaprogramming popularized by Ruby (programming language). Debates about "convention over configuration" trade-offs referenced discussions at conferences including RailsConf, RubyConf, and panels with contributors from Engine Yard and Heroku. Despite criticism, Rails continues to evolve through releases, community governance, and contributions from companies and academic collaborators across the open source landscape.
Category:Web frameworks