Sha256: bd2036a7fe456c86c66a210d86cff21d78de36e85a8660e5b46d67c5e46e1a79

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true
require "kaminari"
require "social-share-button"

module Decidim
  module Proposals
    # This is the engine that runs on the public interface of `decidim-proposals`.
    # It mostly handles rendering the created page associated to a participatory
    # process.
    class Engine < ::Rails::Engine
      isolate_namespace Decidim::Proposals

      routes do
        resources :proposals, only: [:create, :new, :index, :show] do
          resource :proposal_vote, only: [:create, :destroy]
          resource :proposal_widget, only: :show, path: "embed"
        end
        root to: "proposals#index"
      end

      initializer "decidim_proposals.assets" do |app|
        app.config.assets.precompile += %w(decidim_proposals_manifest.js decidim_proposals_manifest.css)
      end

      initializer "decidim_proposals.inject_abilities_to_user" do |_app|
        Decidim.configure do |config|
          config.abilities += ["Decidim::Proposals::Abilities::CurrentUser"]
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
decidim-proposals-0.1.0 lib/decidim/proposals/engine.rb
decidim-0.1.0 decidim-proposals/lib/decidim/proposals/engine.rb
decidim-proposals-0.0.8.1 lib/decidim/proposals/engine.rb
decidim-0.0.8.1 decidim-proposals/lib/decidim/proposals/engine.rb