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.

rubyruby-on-rails-3rails-generate

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.

rubyruby-on-railsscaffolding

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.

rubyubuntu-9.10rvm

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.

rubyversion

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.

rubyruby-on-railsruby-on-rails-3rubygems

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.

rubyternary-operatorconditional-operator

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.

rubycommentsmultilineblock-comments

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.

rubyswitch-statementconditional-statements

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.

rubyfile-io

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.

rubyruby-on-railsjsonpretty-print

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.

rubyruby-on-railsdatabaserake

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.

rubyruby-on-railsruby-on-rails-4deprecated

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.

rubyruby-on-railsruby-on-rails-4crud

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.

rubyruby-on-railsdatabasejoin

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.

rubyruby-on-railsruby-on-rails-3ruby-on-rails-4

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.

rubyruby-on-railsarraysduplicates

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.

rubyarrays

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.

rubyruby-on-railsruby-on-rails-3hashmap

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

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.

rubymethodsnaming-conventionsimmutability

Page 4 of 6 - 112 questions