Say No To Partials And Helpers For A Maintainable Rails Front-End

05-Sep-2024 320
I just read Garrett Dimon’s fantastic article “Structure Your ERb and Partials for more Maintainable Front-end Code in Rails”. It’s a wonderfully thorough discussion of how to use partials and helpers effectively. You should read it. I agree with everything he said. And yet here I am writing a rebuttal.No, “rebuttal” isn’t right, because I don’t disagree with Garrett at all. If you and your team are stuck with the canonical Rails front-end toolkit of ERB partials and helpers, you should absolutely follow Garrett’s advice. But I want to offer a different answer, and that’s to throw out ERB partials and helpers altogether, and use Phlex instead.
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