Active Record queries in views: when it's bad, when it's fine - Code with Jason

Maybe you’ve heard the advice that you shouldn’t put Active Record queries (or other logic) in views, but you’re not sure exactly why, other than “separation of concerns”. Why exactly is separation of concerns good?The rationale behind this advice is that mixing concerns (like query logic vs. presentation) makes the code harder to understand and change.Another way to think about this is to think about what kinds of things tend to change together.
Active Record queries in views: when it's bad, when it's fine - Code with Jason #ruby #rubydeveloper #rubyonrails #active #code #record https://rubyonrails.ba/single/active-record-queries-in-views-when-it-s-bad-when-it-s-fine-code-with-jason

Nezir Zahirovic

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

related articles