Skip to content

Commit

Permalink
Fixes rails#317. AV::Rendering module should be included after AC::Ap…
Browse files Browse the repository at this point in the history
…iRendering
  • Loading branch information
Jorge Bejar and Santiago Pastorino authored and spastorino committed Apr 21, 2016
1 parent 26b32cc commit 64c510e
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 @@ -9,16 +9,18 @@ class Railtie < ::Rails::Railtie
require 'jbuilder/dependency_tracker'
end

if app.config.respond_to?(:api_only) && app.config.api_only
if Rails::VERSION::MAJOR >= 5
module ::ActionController
module ApiRendering
include ActionView::Rendering
end
end

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

0 comments on commit 64c510e

Please sign in to comment.