Better Nested Attributes in Rails with the Cocoon Gem

In this article we are going to discuss how to build more complex forms using Rails’ nested attributes feature. I will show you how to manipulate multiple associated records from a single form and properly set up the models and controller to enable this feature. Also, we are going to discuss common pitfalls and power our form up to make it more dynamic using the gem called Cocoon. This solution allows adding and removing nested fields asynchronously while providing lots of customization options and callbacks.


Better Nested Attributes in Rails with the Cocoon Gem #ruby #rubydeveloper #rubyonrails #gem https://rubyonrails.ba/single/better-nested-attributes-in-rails-with-the-cocoon-gem

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles