Skip to content

Commit

Permalink
Rails 5.0 doesn't equip :action_controller_api on_load hook
Browse files Browse the repository at this point in the history
this reverts 96a8a39 with an improvement
  • Loading branch information
amatsuda committed Jan 17, 2024
1 parent 9db282b commit 5af3835
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/jbuilder/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ module ApiRendering
end
end

ActiveSupport.on_load :action_controller_api do
include ActionController::Helpers
include ActionController::ImplicitRender
ActiveSupport.on_load :action_controller do
if name == 'ActionController::API'
include ActionController::Helpers
include ActionController::ImplicitRender
end
end
end
end
Expand Down

0 comments on commit 5af3835

Please sign in to comment.