summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-06-27 22:52:50 +0200
committererdgeist <erdgeist@erdgeist.org>2026-06-27 22:52:50 +0200
commit9a19a0494ef51cdac9a78e24d517ca48ba44c453 (patch)
tree8eaae12d8047a40e29d3ea7ff3116b5c869e04bd /app/controllers/application_controller.rb
parent85a01e35274b8d4d4165a7b26bd7986e211246bb (diff)
parent1853082fcd8c067390c246f9daa01a9b47387497 (diff)
Migration from Rails 2.3.5 to Rails 8.1 successful.
Merging dev branch.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb35
1 files changed, 15 insertions, 20 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index bce0c71..75f92c3 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,26 +1,21 @@
1# Filters added to this controller apply to all controllers in the application.
2# Likewise, all the methods added will be available for all controllers.
3
4class ApplicationController < ActionController::Base 1class ApplicationController < ActionController::Base
5
6 include ExceptionNotifiable
7 include AuthenticatedSystem 2 include AuthenticatedSystem
8
9 helper :all # include all helpers, all the time
10 protect_from_forgery # See ActionController::RequestForgeryProtection for details
11 3
12 # Scrub sensitive parameters from your log 4 protect_from_forgery
13 filter_parameter_logging :password, :password_confirmation 5
14 6 before_action :set_locale
15 before_filter :set_locale 7
16
17 protected 8 protected
18 9
19 def set_locale 10 def set_locale
20 if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym) 11 if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
21 I18n.locale = params[:locale].to_sym 12 I18n.locale = params[:locale].to_sym
22 else 13 else
23 params.delete(:locale) 14 I18n.locale = I18n.default_locale
24 end
25 end 15 end
16 end
17
18 def default_url_options
19 { locale: I18n.locale == I18n.default_locale ? nil : I18n.locale }
20 end
26end 21end