Sha256: 05180c7bf81e344483e8b6f21666d04eced6e979e44d77a1224865abbf09e831

Contents?: true

Size: 501 Bytes

Versions: 3

Compression:

Stored size: 501 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|
          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

3 entries across 3 versions & 1 rubygems

Version Path
lifeform-0.9.0 lib/lifeform/capturing_renderable.rb
lifeform-0.8.0 lib/lifeform/capturing_renderable.rb
lifeform-0.7 lib/lifeform/capturing_renderable.rb