Sha256: 6ecc11c0db999b427bdc8e6633416b332decce4b408634dfca781eb7552e46d6

Contents?: true

Size: 776 Bytes

Versions: 24

Compression:

Stored size: 776 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class WidgetsController < Decidim::ApplicationController
    skip_authorization_check only: :show
    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.feature.participatory_space
    end

    def iframe_url
      raise NotImplementedError
    end

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

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
decidim-core-0.10.1 app/controllers/decidim/widgets_controller.rb
decidim-core-0.10.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.9.3 app/controllers/decidim/widgets_controller.rb
decidim-core-0.9.2 app/controllers/decidim/widgets_controller.rb
decidim-core-0.9.1 app/controllers/decidim/widgets_controller.rb
decidim-core-0.9.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.8.4 app/controllers/decidim/widgets_controller.rb
decidim-core-0.8.3 app/controllers/decidim/widgets_controller.rb
decidim-core-0.8.2 app/controllers/decidim/widgets_controller.rb
decidim-core-0.8.1 app/controllers/decidim/widgets_controller.rb
decidim-core-0.8.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.7.4 app/controllers/decidim/widgets_controller.rb
decidim-core-0.7.3 app/controllers/decidim/widgets_controller.rb
decidim-core-0.7.2 app/controllers/decidim/widgets_controller.rb
decidim-core-0.7.1 app/controllers/decidim/widgets_controller.rb
decidim-core-0.7.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.6.8 app/controllers/decidim/widgets_controller.rb
decidim-0.6.8 decidim-core/app/controllers/decidim/widgets_controller.rb
decidim-core-0.6.7 app/controllers/decidim/widgets_controller.rb
decidim-0.6.7 decidim-core/app/controllers/decidim/widgets_controller.rb