Sha256: 435b2f827367fb8b1facf87c92346e07c3aefb02bed9f4b893cb53e195a6b00e

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

require "rails"
require "decidim/core"

module Decidim
  module Elections
    # This is the engine that runs on the public interface of elections.
    class Engine < ::Rails::Engine
      isolate_namespace Decidim::Elections

      routes do
        resources :elections, only: [:index, :show] do
          resource :feedback, only: [:show] do
            post :answer
          end

          resource :vote, only: [:new, :update] do
            post :cast
            get :verify
          end
        end

        root to: "elections#index"
      end

      initializer "decidim_elections.add_cells_view_paths" do
        Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Elections::Engine.root}/app/cells")
        Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Elections::Engine.root}/app/views") # for partials
      end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-elections-0.24.3 lib/decidim/elections/engine.rb
decidim-elections-0.24.2 lib/decidim/elections/engine.rb
decidim-elections-0.24.1 lib/decidim/elections/engine.rb
decidim-elections-0.24.0 lib/decidim/elections/engine.rb
decidim-elections-0.24.0.rc2 lib/decidim/elections/engine.rb
decidim-elections-0.24.0.rc1 lib/decidim/elections/engine.rb