diff --git a/actionview/lib/action_view/helpers/cache_helper.rb b/actionview/lib/action_view/helpers/cache_helper.rb index 5a05f8706a..b0b752834e 100644 --- a/actionview/lib/action_view/helpers/cache_helper.rb +++ b/actionview/lib/action_view/helpers/cache_helper.rb @@ -166,7 +166,7 @@ module CacheHelper def cache(name = {}, options = {}, &block) if controller.respond_to?(:perform_caching) && controller.perform_caching name_options = options.slice(:skip_digest, :virtual_path) - safe_concat(fragment_for(cache_fragment_name(name, name_options), options, &block)) + safe_concat(fragment_for(cache_fragment_name(name, **name_options), options, &block)) else yield end diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index 0a28a80d48..cea6dde3c7 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -755,10 +755,10 @@ def form_with(model: nil, scope: nil, url: nil, format: nil, **options, &block) output = capture(builder, &block) options[:multipart] ||= builder.multipart? - html_options = html_options_for_form_with(url, model, options) + html_options = html_options_for_form_with(url, model, **options) form_tag_with_body(html_options, output) else - html_options = html_options_for_form_with(url, model, options) + html_options = html_options_for_form_with(url, model, **options) form_tag_html(html_options) end end diff --git a/actionview/lib/action_view/helpers/tag_helper.rb b/actionview/lib/action_view/helpers/tag_helper.rb index 8eaceb1f87..fc2654a684 100644 --- a/actionview/lib/action_view/helpers/tag_helper.rb +++ b/actionview/lib/action_view/helpers/tag_helper.rb @@ -107,8 +107,8 @@ def respond_to_missing?(*args) true end - def method_missing(called, *args, &block) - tag_string(called, *args, &block) + def method_missing(called, *args, **options, &block) + tag_string(called, *args, **options, &block) end end diff --git a/actionview/lib/action_view/helpers/translation_helper.rb b/actionview/lib/action_view/helpers/translation_helper.rb index baa337c62f..bc5394ef55 100644 --- a/actionview/lib/action_view/helpers/translation_helper.rb +++ b/actionview/lib/action_view/helpers/translation_helper.rb @@ -82,14 +82,14 @@ def translate(key, options = {}) html_safe_options[name] = ERB::Util.html_escape(value.to_s) end end - translation = I18n.translate(scope_key_by_partial(key), html_safe_options.merge(raise: i18n_raise)) + translation = I18n.translate(scope_key_by_partial(key), **html_safe_options.merge(raise: i18n_raise)) if translation.respond_to?(:map) translation.map { |element| element.respond_to?(:html_safe) ? element.html_safe : element } else translation.respond_to?(:html_safe) ? translation.html_safe : translation end else - I18n.translate(scope_key_by_partial(key), options.merge(raise: i18n_raise)) + I18n.translate(scope_key_by_partial(key), **options.merge(raise: i18n_raise)) end rescue I18n::MissingTranslationData => e if remaining_defaults.present? diff --git a/actionview/test/template/form_helper/form_with_test.rb b/actionview/test/template/form_helper/form_with_test.rb index 42069340f1..195db1f5b4 100644 --- a/actionview/test/template/form_helper/form_with_test.rb +++ b/actionview/test/template/form_helper/form_with_test.rb @@ -62,7 +62,7 @@ def form_text(action = "http://www.example.com", local: false, **options) end def whole_form(action = "http://www.example.com", options = {}) - out = form_text(action, options) + hidden_fields(options) + out = form_text(action, **options) + hidden_fields(options) if block_given? out << yield << "" @@ -168,7 +168,7 @@ def test_form_with_with_block_in_erb_and_local_true end class FormWithActsLikeFormForTest < FormWithTest - def form_with(*) + def form_with(*, **) @output_buffer = super end diff --git a/actionview/test/template/text_helper_test.rb b/actionview/test/template/text_helper_test.rb index e961a770e6..a251b48af3 100644 --- a/actionview/test/template/text_helper_test.rb +++ b/actionview/test/template/text_helper_test.rb @@ -368,7 +368,7 @@ def test_word_wrap_with_leading_spaces def test_word_wrap_does_not_modify_the_options_hash options = { line_width: 15 } passed_options = options.dup - word_wrap("some text", passed_options) + word_wrap("some text", **passed_options) assert_equal options, passed_options end