From 5b108206010111988dda39fa8f2f5884c6098027 Mon Sep 17 00:00:00 2001 From: William Wu Date: Sat, 23 Nov 2024 13:39:31 -0800 Subject: [PATCH 1/2] added back render :update with a block to rails 7 --- lib/prototype-rails/on_load_action_controller.rb | 1 + lib/prototype-rails/update_rendering.rb | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 lib/prototype-rails/update_rendering.rb diff --git a/lib/prototype-rails/on_load_action_controller.rb b/lib/prototype-rails/on_load_action_controller.rb index 92302e7..d5542c7 100644 --- a/lib/prototype-rails/on_load_action_controller.rb +++ b/lib/prototype-rails/on_load_action_controller.rb @@ -1,2 +1,3 @@ require 'prototype-rails/selector_assertions' require 'prototype-rails/renderers' +require 'prototype-rails/update_rendering' diff --git a/lib/prototype-rails/update_rendering.rb b/lib/prototype-rails/update_rendering.rb new file mode 100644 index 0000000..5cdea94 --- /dev/null +++ b/lib/prototype-rails/update_rendering.rb @@ -0,0 +1,16 @@ +require 'action_controller/metal/rendering' + +module ActionController::Rendering::UpdateRendering + + private + + # Normalize arguments by catching blocks and setting them on :update. + # Copied from rails 6 + def _normalize_args(action = nil, options = {}, &blk) + options = super + options[:update] = blk if block_given? + options + end +end + +ActionController::Rendering.include ActionController::Rendering::UpdateRendering From 333ccc92ddd29e8a725d5b985ea2d5cb32d568ff Mon Sep 17 00:00:00 2001 From: William Wu Date: Sat, 23 Nov 2024 13:56:34 -0800 Subject: [PATCH 2/2] update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a1a6bd7..a6b1637 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -This fork provides thoroughly untested and unsupport Rails 5 compatability for `prototype-rails`. +This fork provides thoroughly untested and unsupport Rails 7 compatability for `prototype-rails`.