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`. 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