Backend Technologies · Ruby
Ruby on Rails — Free Learning Resources
Free, printable resources for Ruby on Rails — practice problems, quick-reference cheatsheet, and an interview prep sheet. No sign-up required.
Ruby on Rails — Practice Worksheet
Structured exercises and problems to build hands-on Ruby on Rails skills. Work through key concepts step by step.
Ruby on Rails — Cheatsheet
One-page quick-reference for Ruby on Rails — key syntax, commands, patterns, and best practices at a glance.
Ruby on Rails — Interview Sheet
Top Ruby on Rails interview questions with concise answers. Get ready for any technical round with this focused prep sheet.
About Ruby on Rails
Ruby on Rails is a full-stack web framework following MVC and two core principles: Convention over Configuration (CoC) and Don't Repeat Yourself (DRY). Rails pioneered modern web development practices — database migrations, RESTful routing, integrated testing, and scaffolding — and still powers GitHub, Shopify, and Basecamp.
Ruby on RailsCheat Sheet — What's Covered
- ✓ActiveRecord ORM — migrations, associations, scopes, and callbacks
- ✓RESTful routing — resources, nested routes, and custom actions
- ✓Rails MVC — controllers, strong parameters, and before_action filters
- ✓Action View — ERB templates, partials, layouts, and view helpers
- ✓ActiveJob, Action Mailer, Active Storage, and Hotwire/Turbo
Frequently Asked Questions — Ruby on Rails
What does 'Convention over Configuration' mean in Rails?
Rails assumes sensible defaults — a User model maps to users table, its controller is UsersController, views live in app/views/users/. You only configure where you deviate. This eliminates boilerplate and lets teams focus on application logic.
How do Rails migrations work?
Migrations are versioned Ruby scripts describing schema changes (create_table, add_column). Run rails db:migrate to apply; rails db:rollback to reverse the latest. Rails tracks applied migrations in schema_migrations. Never edit schema.rb directly.
What is ActiveRecord and how do associations work?
ActiveRecord is Rails' ORM mapping Ruby objects to database rows. Declare associations with has_many :posts, belongs_to :user, etc. Use .includes(:association) for eager loading to prevent N+1 queries. Rails generates the correct SQL automatically.
What are strong parameters?
Strong parameters whitelist which attributes a controller accepts from user input, preventing mass-assignment vulnerabilities. Define them in a private method: params.require(:user).permit(:name, :email), then pass to model.create/update.
What is Hotwire and how does it change Rails development?
Hotwire (Turbo + Stimulus) enables SPA-like interactivity without writing much JavaScript. Turbo Drive intercepts navigations; Turbo Frames and Streams update parts of the page over a WebSocket. It lets Rails developers build reactive UIs while keeping logic on the server.
Who Is This For?
Ruby developers building web applications who value rapid development, strong conventions, and a rich ecosystem for common functionality.