File: application_controller.rb

package info (click to toggle)
ruby-derailed-benchmarks 1.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 760 kB
  • sloc: ruby: 1,317; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 376 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class ApplicationController < ActionController::Base
  if respond_to?(:before_filter) && !respond_to?(:before_action)
    class << self
      alias :before_action :before_filter
    end
  end

  protect_from_forgery
  before_action :pull_out_locale


  def pull_out_locale
    I18n.locale = params[:locale] if params[:locale].present?
  end
end