Questions
Ruby questions
Choose a question page, learn the concept, then test your understanding with a quiz.
How to Undo a Rails Generator: Reversing `rails generate` in Ruby on Rails
Learn how to reverse `rails generate` in Rails, remove created files, and roll back route and config changes safely.
How to Undo a Scaffold in Rails
Learn how to undo a scaffold in Rails using generators, migrations, and cleanup steps with practical examples for beginners.
How to Uninstall RVM on Ubuntu: Understanding Safe Tool Removal
Learn how to uninstall RVM on Ubuntu safely, remove shell changes, and understand what a version manager modifies on your system.
How to Update Ruby on macOS Yosemite with Homebrew
Learn how to update Ruby on macOS Yosemite using Homebrew, set the correct PATH, and verify the newer Ruby version works.
How to Use a Local Gem in a Gemfile with Bundler (Ruby)
Learn how to reference a local gem in a Ruby Gemfile using Bundler, with syntax, examples, common mistakes, and practical usage.
How to Use the Conditional Operator in Ruby
Learn how Ruby's conditional operator `? :` works, when to use it, and how to write clean ternary expressions with practical examples.
How to Write Multi-Line Comments in Ruby
Learn how multi-line comments work in Ruby, including =begin/=end, line comments, common mistakes, and practical Ruby examples.
How to Write a Switch Statement in Ruby
Learn how switch-style logic works in Ruby using `case`, `when`, and `else`, with examples, common mistakes, and practical usage tips.
How to Write to a File in Ruby
Learn how to write text files in Ruby, save database results, and use Ruby file handling methods with simple examples.
Pretty Formatting JSON Output in Ruby on Rails
Learn how to pretty format JSON in Ruby on Rails using built-in Ruby tools, with examples, pitfalls, and practical debugging use cases.
Rails Database Tasks Explained: db:migrate vs db:reset vs db:schema:load
Learn the difference between Rails db:migrate, db:reset, and db:schema:load with examples, use cases, mistakes, and a practical mini project.
Rails I18n Locale Validation Warning: enforce_available_locales Explained
Learn what Rails I18n.enforce_available_locales does, why the deprecation warning appears, and whether setting it to false is safe.
Rails before_action vs before_filter: What's the Difference in Rails 4?
Learn the difference between before_action and before_filter in Rails 4, why Rails changed the name, and how callbacks work in controllers.
Rails includes vs joins: Understanding Eager Loading and SQL Joins in ActiveRecord
Learn the difference between Rails includes and joins, why includes may run separate queries, and when ActiveRecord uses joins.
Rails update_attributes Without Saving: How to Assign Multiple Attributes First
Learn how to update multiple ActiveRecord attributes in Rails without saving yet, using assign_attributes and mass assignment safely.
Remove Duplicate Elements from an Array in Ruby
Learn how to remove duplicate values from a Ruby array using built-in methods like uniq and uniq! with clear examples and common pitfalls.
Remove Empty Strings from an Array in JavaScript
Learn how to remove blank elements from a JavaScript array using filter(), truthy checks, and safe patterns for real projects.
Remove a Key from a Hash in Ruby: delete vs reject and Returning the Remaining Hash
Learn how to remove keys from a Ruby Hash using delete, reject, except, and non-mutating patterns with clear examples and common pitfalls.
Ruby &: Symbol-to-Proc Shortcut Explained
Learn why `&:foo` works in Ruby, how Symbol-to-Proc conversion happens, and when to use it instead of a normal block.
Ruby Bang Methods Explained: What ! Means in Ruby Method Names
Learn what exclamation marks mean in Ruby method names, when bang methods are used, and how they differ from non-bang methods.