Rails Concerns: When And How To Use Them
Learn how Rails Concerns work, when to use ActiveSupport::Concern, and when concerns make your Rails app harder to maintain.
Jean Emmanuel is a Full-Stack Software Engineer specializing in Ruby on Rails and the modern Rails ecosystem. He builds scalable, maintainable web applications using Rails, Hotwire (Turbo & Stimulus), PostgreSQL, and SQLite, with a focus on fast, dynamic user experiences. Through CodeCurious, he shares practical lessons, development insights, and real-world solutions for modern developers.
Learn how Rails Concerns work, when to use ActiveSupport::Concern, and when concerns make your Rails app harder to maintain.
Learn how to configure Rails Content Security Policy, use nonces, test in report-only mode, and fix CSP violations step by step.
Learn Rails Active Storage: file uploads, has_one_attached, variants, direct uploads, S3, validations, and production tips.
Learn how the Rails request lifecycle works, from the web server and middleware to routing, controllers, views, and the response.
Learn how Rails autoloading works with Zeitwerk, including naming rules, eager loading, namespaces, and fixing NameError.
Learn how Rails scopes make Active Record queries cleaner, reusable, and easier to maintain with practical examples.
Learn how Rails cache keys work, including cache_key, cache_key_with_version, fragment caching, and cache invalidation.
Learn the difference between pluck and select in Rails, what SQL each generates, and when to use them in Active Record queries.
Learn when to use find_each vs. each in Rails, how batching works, and how to process large datasets without memory issues.
Learn the difference between Rails joins and left_joins, how each generates SQL, and how to avoid common query mistakes.