rails-guide-store/app/controllers/application_controller.rb

13 lines
387 B
Ruby
Raw Permalink Normal View History

2025-01-24 17:32:29 +00:00
class ApplicationController < ActionController::Base
include Authentication
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
allow_browser versions: :modern
around_action :switch_locale
def switch_locale(&action)
locale = params[:locale] || I18n.default_locale
I18n.with_locale(locale, &action)
end
end