Sha256: e25ee5e7642380bc8f4ea1cebda06f8a4e6725add611bc96d64b22133159f1f2
Contents?: true
Size: 941 Bytes
Versions: 11
Compression:
Stored size: 941 Bytes
Contents
# frozen_string_literal: true module Decidim module DecidimAwesome module IframeComponent class IframeController < DecidimAwesome::IframeComponent::ApplicationController ALLOWED_ATTRIBUTES = %w(src width height frameborder title allow allowpaymentrequest name referrerpolicy sandbox srcdoc allowfullscreen).freeze helper_method :iframe, :remove_margins?, :viewport_width? def show; end private def iframe @iframe ||= sanitize(current_component.settings.iframe).html_safe end def sanitize(html) sanitizer = Rails::Html::SafeListSanitizer.new sanitizer.sanitize(html, tags: %w(iframe), attributes: ALLOWED_ATTRIBUTES) end def remove_margins? current_component.settings.no_margins end def viewport_width? current_component.settings.viewport_width end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems