Sha256: 53675522a9ce34edc60a262811c2b0237450918c522b7fcebc30ac245904f007

Contents?: true

Size: 757 Bytes

Versions: 1

Compression:

Stored size: 757 Bytes

Contents

module Pageflow
  module Chart
    module ScrapedSitesHelper
      IFRAME_ATTRIBUTES = {
        style: 'width: 100%; height: 100%',
        scrolling: 'auto',
        frameborder: '0',
        align: 'aus',
        allowfullscreen: 'true',
        mozallowfullscreen: 'true',
        webkitallowfullscreen: 'true'
      }

      def scraped_site_iframe(scraped_site_id)
        scraped_site = ScrapedSite.find_by_id(scraped_site_id)
        data_attributes = {}

        if scraped_site
          data_attributes = {
            src: scraped_site.html_file_url,
            use_custom_theme: scraped_site.use_custom_theme
          }
        end

        content_tag(:iframe, '', IFRAME_ATTRIBUTES.merge(data: data_attributes))
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pageflow-chart-0.2.0 app/helpers/pageflow/chart/scraped_sites_helper.rb