Using Concerns with Ruby on Rails | Cody Norman Personal Website

11-Aug-2023 907
For the past few months, I’ve been holding standups and office hours with a top-notch group of early career developers. After everyone gives their update, we take some time and try to go into more detail about one of the issues they’re having. Topics have ranged from database migrations and when to use the up and down methods over change, helper methods, how and what to test and plenty more.On one of these in-depth conversations, we found ourselves tracing down a method definition that led us to a module using ActiveSupport::Concern, as I’ll refer to it from here on out, a Concern.I’ve used Concerns a ton over the years but it’s a topic I’ve never had to look into more than just a quick skim of the docs to check the syntax or make a few changes to an existing Concern.I realized that while I knew how to use Concerns, I didn’t know enough to be able to explain all of the details without re-visiting the documentation.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle