Sharing common code between Rails controllers with Scoped pattern
18-Mar-2021 1468
This particular pattern comes from DHH and Basecamp – a codebase that prides itself of using lots of tiny concerns to share bits of behavior.While the savings of repeating the same before_actions to look up a Channel would be a fine benefit on it’s own, the naming convention of Scoped is such a great, sharp name. Playlists are “scoped” to a channel so it makes total sense that the corresponding controller would be “channel scoped”.
Sharing common code between Rails controllers with Scoped pattern #ruby #rubydeveloper #rubyonrails #Sharing #common #between #Rails #controllers #Scoped #pattern #code https://www.rubyonrails.ba/link/sharing-common-code-between-rails-controllers-with-scoped-pattern