Sha256: b27dd31f170bacbb652e803704a2dd98287f3dfe86026717afba58b84caaf7cb

Contents?: true

Size: 737 Bytes

Versions: 68

Compression:

Stored size: 737 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class WidgetsController < Decidim::ApplicationController
    skip_before_action :verify_authenticity_token
    after_action :allow_iframe, only: :show
    helper ResourceHelper

    layout "decidim/widget"

    helper_method :model, :iframe_url, :current_participatory_space

    def show
      respond_to do |format|
        format.js { render "decidim/widgets/show" }
        format.html
      end
    end

    private

    def current_participatory_space
      @current_participatory_space ||= model.component.participatory_space
    end

    def iframe_url
      raise NotImplementedError
    end

    def allow_iframe
      response.headers.delete "X-Frame-Options"
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
decidim-core-0.23.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.22.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.21.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.20.1 app/controllers/decidim/widgets_controller.rb
decidim-core-0.20.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.19.1 app/controllers/decidim/widgets_controller.rb
decidim-core-0.18.1 app/controllers/decidim/widgets_controller.rb
decidim-core-0.19.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.17.2 app/controllers/decidim/widgets_controller.rb
decidim-core-0.18.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.17.1 app/controllers/decidim/widgets_controller.rb
decidim-core-0.16.1 app/controllers/decidim/widgets_controller.rb
decidim-core-0.17.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.16.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.15.2 app/controllers/decidim/widgets_controller.rb
decidim-core-0.15.1 app/controllers/decidim/widgets_controller.rb
decidim-core-0.15.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.14.4 app/controllers/decidim/widgets_controller.rb
decidim-core-0.14.3 app/controllers/decidim/widgets_controller.rb
decidim-core-0.14.2 app/controllers/decidim/widgets_controller.rb