40 Fun Facts About Ruby on Rails
Learn something new, then test yourself with the quiz.
Know these facts? Prove it.
Take the 40-question quizRuby on Rails was extracted from which project management tool built at the web company 37signals?
Basecamp was the product; the framework underneath it was pulled out and released as open source in July 2004.
Which social network moved parts of its Ruby on Rails stack to Scala after outages in 2007 and 2008?
Twitter kept Rails for its user interface until 2011, and the framework's creator blamed the outages on the company's own architecture rather than on Rails.
Which Danish programmer wrote Ruby on Rails, earning a Hacker of the Year award at OSCON in 2005?
David Heinemeier Hansson wrote the framework while building a web app for 37signals, then moved from Denmark to Chicago in November 2005.
The creator of Ruby on Rails is also a racing driver who has competed in which famous motor race?
The 24 Hours of Le Mans had him on the grid in 2012 with OAK Racing, in a season he also spent racing prototypes in the American Le Mans Series.
Ruby, the language behind Rails, got its name partly because ruby was what to a colleague of its creator?
Birthstone is the link. The name came out of an online chat in February 1993, before any code existed, and it beat the other candidate, Coral.
Which code-hosting site built with Ruby on Rails was hacked in 2012 to demonstrate a mass assignment flaw?
GitHub was the target of researcher Egor Homakov, who broke in harmlessly after his earlier warnings about the weakness had been dismissed.
Rails names its technique of nesting cached page fragments inside one another after which toy?
Russian dolls fit the idea: when one inner fragment changes, the untouched ones are reused while the outer fragment is rebuilt around them.
Which e-commerce platform grew out of Snowdevil, a snowboard shop its founder built with Ruby on Rails?
Shopify began when Tobias Lütke, unhappy with the store software on the market, wrote his own and launched the shop after two months of work.
Which programmer designed Ruby, the language behind Rails, to make coders productive and happy?
Yukihiro Matsumoto, known as Matz, announced the first public release of Ruby in December 1995, nearly a decade before Rails made the language famous.
Which Ruby on Rails principle explains why a model class called Sale maps to a table named sales?
Convention over configuration means a developer writes code only for the unusual cases, such as a table whose name Rails would never guess.
Which Rails component, named after a Martin Fowler design pattern, maps database tables to Ruby classes?
Active Record is the M in MVC: it lets Ruby objects be saved to and loaded from a database without the developer writing SQL by hand.
Ruby on Rails has been released as open-source software since 2004 under which licence?
The MIT License covers the code but not the branding: in 2007 the framework's creator applied to register the Rails name and logo as trademarks.
Which Rails generator produces a full set of CRUD files, from database table to web pages, in one command?
The scaffold generator is meant for quick prototypes and starting points; its lighter cousin, the resource generator, creates no views and leaves the controller empty.
Which Rails feature lets developers evolve a database schema over time in Ruby instead of hand-written SQL?
Migrations each act as a new version of the database, so Rails can bring any copy of the schema forward from wherever it stands in that history.
Which file in the root of a Rails app lists the Ruby libraries the application depends on?
The Gemfile and its companion lock file are read by Bundler, the tool that fetches every gem a Rails application needs.
A new Rails app ships with three environments by default: development, test and which other?
The production environment completes the set; the guides suggest adding a custom one when a server mirrors the live site but is used only for testing.
A newly generated Rails application is set up to use which database unless told otherwise?
SQLite needs no separate database server and keeps an entire database in a single file, so a fresh project runs with nothing extra to install.
Running the rails server command starts a Rails application listening on which port by default?
Port 3000 is the default, which is why Rails tutorials point browsers at that number on localhost; the -p option picks a different one.
Rails views are written by default in which templating system that embeds Ruby code inside HTML?
ERB stands for Embedded Ruby, which is why a typical Rails view file has a name ending in .html.erb.
In a standard Rails resource, which HTTP verb is mapped to the controller's create action?
POST is paired with create. Because the router matches the verb as well as the path, four URLs are enough to reach all seven standard actions.
Which file in a Rails app's config folder maps incoming URLs to controller actions?
The routes.rb file is matched from top to bottom in the order its lines are written, so moving a line up can change which action answers a URL.
Among the seven standard actions of a Rails resource controller, which one displays a list of all records?
The index action answers a GET request to the collection path, such as /photos, while show handles a single record at /photos/:id.
Rails pluralises model names to find their tables, so a model class named Person maps to which table?
The people table shows that Rails handles irregular English plurals, and multi-word names get underscores too: LineItem maps to line_items.
Rails automatically fills in which column with the date and time a record was first saved?
The created_at column is one of a pair added by the timestamps macro; its partner, updated_at, changes again on every later save.
Which Rails association goes on the model whose table holds the foreign key, such as a book's author_id?
A belongs_to association takes a singular name, as in a book and its author, and unless marked optional it refuses to save when the associated record is missing.
What do Rails developers call the trap where loading a list fires one extra database query per record?
The N+1 problem adds up fast: printing ten books with their authors takes eleven queries, which the includes method avoids by loading the authors in advance.
Rails adds a required security token to forms and other non-GET requests to block which kind of attack?
CSRF, or cross-site request forgery, abuses a session the victim is still logged in to; a token that only the real site knows exposes the forged request.
Which reusable Rails view templates have filenames that begin with an underscore, such as _menu?
Partials carry the underscore only in the filename: a view asks to render "menu" and Rails goes looking for the file with the underscore in front.
Which web server, derived from Mongrel, is bundled with Rails and boots on the rails server command?
Puma was written by Evan Phoenix with an emphasis on speed and frugal memory use, and it is also the web server shipped with Mastodon.
Which JavaScript library became the Rails default in version 3.1, until Rails 5.1 stopped depending on it?
jQuery arrived in the same release as CoffeeScript, and bowed out when Rails rewrote its own helper scripts in plain JavaScript.
Since Rails 7.0, new apps include which family of JavaScript libraries, home to Turbo and Stimulus?
Hotwire is short for HTML over the wire: the server sends finished HTML rather than JSON, so an app needs far less JavaScript of its own.
Which rival Ruby web framework, co-developed by Yehuda Katz, was merged into Rails for the 3.0 release?
Merb began as a clean-room rewrite of the Rails controller layer, and the merger carried its focus on speed and modularity into Rails itself.
Apple announced in 2006 that it would ship Ruby on Rails with which version of Mac OS X?
Leopard, version 10.5, reached users in October 2007, putting a framework that was barely three years old on every Mac that ran it.
Which library, new in Rails 4.0, swaps in each new page's body instead of doing a full page load?
Turbolinks fetches a clicked link's page in the background and swaps in its body; Rails 7.0 replaced it with a successor called Turbo.
Which framework, added in Rails 5.0, brings WebSockets into a Rails app for real-time features such as chat?
Action Cable works on a publish and subscribe model, so the server can broadcast one message to every browser subscribed to a channel.
Which framework, new in Rails 5.2, attaches uploaded files to models using services such as Amazon S3?
Active Storage also comes with a local disk service for development and testing, and it can mirror files to a second service as a backup.
Which code loader has Rails used exclusively since version 7.0 to find classes without any require calls?
Zeitwerk expects each file name to match the constant it defines, so users_controller.rb must define UsersController, with folders acting as namespaces.
Rails single table inheritance stores each row's model name in a column with which default name?
The type column tells Rails which model each row represents; a legacy table can use another name by overriding the inheritance column.
Which Ruby testing library sits beneath ActiveSupport::TestCase, the parent class of Rails test cases?
Minitest treats any method whose name begins with test_ as a test and runs it automatically, which is why Rails test methods are named that way.
Rails has been built since version 2.3 on which modular interface between Ruby web servers and frameworks?
Rack reduces every request to a single method call, so any compliant web server can be swapped in beneath any framework built on it.
Think you know Ruby on Rails?
Put these facts to the test with the interactive quiz.
Take the 40-question quizTeaching Ruby on Rails?
Make a custom quiz — handy for classrooms and study groups.
Make a quiz on anything