I use this helper, so I don't need to explicitly pass the locale for every cache
call:
# frozen_string_literal: true module CacheHelper # Always using current I18n.locale to cache things. def cache(name = {}, options = {}, &block) name_with_locale = [name].flatten << I18n.locale.to_s super(name_with_locale, options, &block) end end
source share