Sha256: ee25037caf3c6ebbedf216183acf6e909b79a9f58a2a39c20b40a74639b37b6d

Contents?: true

Size: 545 Bytes

Versions: 1

Compression:

Stored size: 545 Bytes

Contents

# frozen_string_literal: true

module BeyondCanvas
  class ApplicationController < ActionController::Base
    protect_from_forgery with: :exception

    include ::BeyondCanvas::LocaleManagement

    def update_locale
      cookies[:locale] = { value: app_locale_params[:locale], expires: 1.day.from_now }
      set_locale

      redirect_back(fallback_location: main_app.root_path)
    end

    private

    #
    # Strong parameters for locale switch
    #
    def app_locale_params
      params.require(:app).permit(:locale)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
beyond_canvas-0.12.0.pre app/controllers/beyond_canvas/application_controller.rb