Sha256: 5a4a2157a90e19873464c820e2afcb3a8ebc4169b97303bbe7b713c9c9952ed0

Contents?: true

Size: 508 Bytes

Versions: 2

Compression:

Stored size: 508 Bytes

Contents

# frozen_string_literal: true

module Lifeform
  module CapturingRenderable
    # NOTE: the previous `with_output_buffer` stuff is for some reason incompatible with Serbea.
    # So we'll use a simpler capture.
    def render_in(view_context, &block)
      if block
        call(view_context: view_context) do |*args, **kwargs|
          unsafe_raw(view_context.capture(*args, **kwargs, &block))
        end.html_safe
      else
        call(view_context: view_context).html_safe
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lifeform-0.11.0 lib/lifeform/capturing_renderable.rb
lifeform-0.10.0 lib/lifeform/capturing_renderable.rb