We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a75dac3 + 07e0e81 commit e980a8aCopy full SHA for e980a8a
lib/react/rails/controller_lifecycle.rb
@@ -4,9 +4,11 @@ module ControllerLifecycle
4
extend ActiveSupport::Concern
5
6
included do
7
- # use old names to support Rails 3
8
- before_filter :setup_react_component_helper
9
- after_filter :teardown_react_component_helper
+ # use both names to support Rails 3..5
+ before_action_with_fallback = respond_to?(:before_action) ? :before_action : :before_filter
+ after_action_with_fallback = respond_to?(:after_action) ? :after_action : :after_filter
10
+ public_send(before_action_with_fallback, :setup_react_component_helper)
11
+ public_send(after_action_with_fallback, :teardown_react_component_helper)
12
attr_reader :__react_component_helper
13
end
14
0 commit comments