Module: Upkeep::Rails::ActionViewCapture::ViewHelpers

Defined in:
lib/upkeep/rails/action_view_capture.rb

Instance Method Summary collapse

Instance Method Details

#render_site(site_id, manifest_path: nil, manifest_fingerprint: nil) ⇒ Object



721
722
723
724
725
726
727
728
729
730
731
732
733
# File 'lib/upkeep/rails/action_view_capture.rb', line 721

def render_site(site_id, manifest_path: nil, manifest_fingerprint: nil)
  html = Upkeep::Rails::ActionViewCapture.with_render_site(
    {
      site_id: site_id,
      manifest_path: manifest_path,
      manifest_fingerprint: manifest_fingerprint
    }.compact
  ) do
    yield
  end

  html.respond_to?(:html_safe) ? html.html_safe : html
end

#upkeep_frame_idObject



716
717
718
719
# File 'lib/upkeep/rails/action_view_capture.rb', line 716

def upkeep_frame_id
  Upkeep::Rails::ActionViewCapture.current_frame_id ||
    raise("upkeep_frame_id is only available while rendering an Upkeep frame")
end

#upkeep_page_frame_idObject



711
712
713
714
# File 'lib/upkeep/rails/action_view_capture.rb', line 711

def upkeep_page_frame_id
  Upkeep::Rails::ActionViewCapture.current_frame_id ||
    raise("upkeep_page_frame_id is only available while rendering an Upkeep page frame")
end