Sha256: 5bed2376f38e939eb7ca0a6211346b89e3844bdde081332db8340df7c474dced

Contents?: true

Size: 758 Bytes

Versions: 14

Compression:

Stored size: 758 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

    layout "decidim/widget"

    helper_method :model, :iframe_url, :current_participatory_process

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

    private

    def current_participatory_process
      @current_participatory_process ||= model.feature.participatory_process
    end

    def iframe_url
      raise NotImplementedError
    end

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

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
decidim-core-0.5.1 app/controllers/decidim/widgets_controller.rb
decidim-0.5.1 decidim-core/app/controllers/decidim/widgets_controller.rb
decidim-core-0.5.0 app/controllers/decidim/widgets_controller.rb
decidim-0.5.0 decidim-core/app/controllers/decidim/widgets_controller.rb
decidim-core-0.4.4 app/controllers/decidim/widgets_controller.rb
decidim-core-0.4.2 app/controllers/decidim/widgets_controller.rb
decidim-core-0.4.1 app/controllers/decidim/widgets_controller.rb
decidim-core-0.4.3 app/controllers/decidim/widgets_controller.rb
decidim-core-0.4.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.3.2 app/controllers/decidim/widgets_controller.rb
decidim-core-0.3.1 app/controllers/decidim/widgets_controller.rb
decidim-core-0.3.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.2.0 app/controllers/decidim/widgets_controller.rb
decidim-core-0.1.0 app/controllers/decidim/widgets_controller.rb