As I’ve progressed in my career as a software developer, I’ve found it extremely helpful to read not only documentation but also to read code. Early on in my career, this was a little bit intimidating, but it’s a practice I highly recommend. Rails is a great codebase to read, especially if you’re familiar with using Rails because so much of what we might view as magic is Ruby we can understand and read behind the scenes.
In a previous post we took a deep dive into how to use
has_many through to create complex nested forms. While writing that post, I took a dive into the Rails codebase to understand how
accepts_nested_attributes actually works and found it interesting and wanted to share if this was something you may be curious about well.
When I’m looking for a method in a codebase, I search the method name in the search bar on the repo. Typing in accepts_nested_attributes_for takes me here.