diff --git a/lib/jquery-rjs/action_controlller_rendering.rb b/lib/jquery-rjs/action_controlller_rendering.rb new file mode 100644 index 0000000..fe6c414 --- /dev/null +++ b/lib/jquery-rjs/action_controlller_rendering.rb @@ -0,0 +1,14 @@ +if Rails.version >= "7.1.0.0" + require 'action_controller/metal/rendering' + + module JqueryRjs::ActionControllerRendering + # Normalize arguments by catching blocks and setting them on :update. + def _normalize_args(action = nil, options = {}, &blk) + options = super + options[:update] = blk if block_given? + options + end + end + + ActionController::Rendering.prepend(JqueryRjs::ActionControllerRendering) +end diff --git a/lib/jquery-rjs/on_load_action_controller.rb b/lib/jquery-rjs/on_load_action_controller.rb index 31fa0ec..5592694 100644 --- a/lib/jquery-rjs/on_load_action_controller.rb +++ b/lib/jquery-rjs/on_load_action_controller.rb @@ -1,2 +1,3 @@ +require 'jquery-rjs/action_controlller_rendering' require 'jquery-rjs/selector_assertions' require 'jquery-rjs/renderers'