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



716
717
718
719
720
721
722
723
724
725
726
727
728
# File 'lib/upkeep/rails/action_view_capture.rb', line 716

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

  %(<upkeep-render-site data-upkeep-render-site="#{CGI.escapeHTML(site_id.to_s)}">#{html}</upkeep-render-site>).html_safe
end

#upkeep_frame_idObject



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

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



706
707
708
709
# File 'lib/upkeep/rails/action_view_capture.rb', line 706

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