diff --git a/Gemfile b/Gemfile index c08d372a5..0f15ad8c2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,5 @@ source "https://rubygems.org" -ruby File.read(".ruby-version").strip - gem "rails", "6.0.3.3" gem "dalli" diff --git a/Gemfile.lock b/Gemfile.lock index 1a6ed3100..9dd8fb63e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -71,7 +71,7 @@ GEM rack (>= 0.9.0) binding_of_caller (0.8.0) debug_inspector (>= 0.0.1) - brakeman (4.8.2) + brakeman (4.9.1) builder (3.2.4) capybara (3.33.0) addressable @@ -137,7 +137,7 @@ GEM domain_name (~> 0.5) i18n (1.8.5) concurrent-ruby (~> 1.0) - image_size (2.0.2) + image_size (2.1.0) io-like (0.3.1) jasmine (3.6.0) jasmine-core (~> 3.6.0) @@ -197,8 +197,8 @@ GEM pry (0.13.1) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (4.0.5) - puma (4.3.5) + public_suffix (4.0.6) + puma (4.3.6) nio4r (~> 2.0) rack (2.2.3) rack-test (1.1.0) @@ -266,8 +266,8 @@ GEM rubocop-ast (>= 0.1.0, < 1.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (0.2.0) - parser (>= 2.7.0.1) + rubocop-ast (0.3.0) + parser (>= 2.7.1.4) rubocop-govuk (3.17.0) rubocop (= 0.87.1) rubocop-rails (= 2.6.0) @@ -400,8 +400,5 @@ DEPENDENCIES webmock wraith -RUBY VERSION - ruby 2.6.6 - BUNDLED WITH 1.17.3 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e9b831c96..41e929d77 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -18,6 +18,6 @@ def content_item_path .compact .join(".") - "/" + URI.encode(path_and_optional_locale) # rubocop:disable Lint/UriEscapeUnescape + "/" + URI.encode_www_form_component(path_and_optional_locale).gsub("%2F", "/") end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e7ca95305..274bdd347 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -4,9 +4,9 @@ def page_text_direction end def t_locale_fallback(key, options = {}) - options["locale"] = I18n.locale + options[:locale] = I18n.locale options[:fallback] = nil - translation = I18n.t(key, options) + translation = I18n.t(key, **options) if translation.nil? || translation.include?("translation missing") I18n.default_locale