Skip to content

Commit 5af3835

Browse files
committed
Rails 5.0 doesn't equip :action_controller_api on_load hook
this reverts 96a8a39 with an improvement
1 parent 9db282b commit 5af3835

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/jbuilder/railtie.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ module ApiRendering
1616
end
1717
end
1818

19-
ActiveSupport.on_load :action_controller_api do
20-
include ActionController::Helpers
21-
include ActionController::ImplicitRender
19+
ActiveSupport.on_load :action_controller do
20+
if name == 'ActionController::API'
21+
include ActionController::Helpers
22+
include ActionController::ImplicitRender
23+
end
2224
end
2325
end
2426
end

0 commit comments

Comments
 (0)