Stateless Forms with the Rails Attributes API: No Active Record? No Problem!

One of the ironies of working with Ruby on Rails is that making a feature do less often results in more work. For a great example of this, consider the ingredients that go into a standard Rails form: route, controller, ERB template, Active Record model. If you do things “The Rails Way”, we could have everything working in just a few minutes.Now take that form and swap out the Active Record models in favor of plain ol' Ruby objects. Suddenly nothing works! (That’s what we get for going off the Rails, I guess.)I recently had to work through this myself, but arrived at a surprisingly simple solution enabled by the sorta-public-but-still-kinda-private Attributes API.
Stateless Forms with the Rails Attributes API: No Active Record? No Problem! #ruby #rubydeveloper #rubyonrails #active #api: #record? https://rubyonrails.ba/single/stateless-forms-with-the-rails-attributes-api-no-active-record-no-problem

Nezir Zahirovic

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

related articles