Active Record queries in views: when it's bad, when it's fine - Code with Jason
04-Mar-2021 1041
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 #Record #queries #views: #Jason #active #code #record https://rubyonrails.ba/link/active-record-queries-in-views-when-it-s-bad-when-it-s-fine-code-with-jason