Module: Jb::TemlateResultCaster

Defined in:
lib/jb/action_view_monkeys.rb

Overview

Rails 7.1+: A monkey-patch not to stringify rendered object from JB templates

Instance Method Summary collapse

Instance Method Details

#_run(method, template) ⇒ Object



25
26
27
28
29
# File 'lib/jb/action_view_monkeys.rb', line 25

def _run(method, template, *, **)
  val = super
  val = Jb::TemplateResult.new val if template.respond_to?(:handler) && (template.handler == Jb::Handler)
  val
end