Skip to content

Commit

Permalink
Enable template rendering in API only Rails apps (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbelToy authored Apr 7, 2024
1 parent 5e93dba commit 2a39d92
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/props_template/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,18 @@ class Railtie < ::Rails::Railtie
require "props_template/layout_patch"
end
end

module ::ActionController
module ApiRendering
include ActionView::Rendering
end
end

ActiveSupport.on_load :action_controller do
if name == "ActionController::API"
include ActionController::Helpers
include ActionController::ImplicitRender
end
end
end
end

0 comments on commit 2a39d92

Please sign in to comment.