Sha256: 796174863747b39f09e275aa4e903dcb89a76bda8dfc8e0e7c2d6982a4deb0c5

Contents?: true

Size: 1.13 KB

Versions: 26

Compression:

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

          resources :votes, only: [:new, :create, :update, :show] do
            get :verify
            match "new", action: :new, via: :post, as: :login, on: :collection
          end

          get :election_log, on: :member
        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.webpacker.assets_path" do
        Decidim.register_assets_path File.expand_path("app/packs", root)
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
decidim-elections-0.27.9 lib/decidim/elections/engine.rb
decidim-elections-0.27.8 lib/decidim/elections/engine.rb
decidim-elections-0.27.7 lib/decidim/elections/engine.rb
decidim-elections-0.27.6 lib/decidim/elections/engine.rb
decidim-elections-0.26.10 lib/decidim/elections/engine.rb
decidim-elections-0.26.9 lib/decidim/elections/engine.rb
decidim-elections-0.27.5 lib/decidim/elections/engine.rb
decidim-elections-0.26.8 lib/decidim/elections/engine.rb
decidim-elections-0.27.4 lib/decidim/elections/engine.rb
decidim-elections-0.27.3 lib/decidim/elections/engine.rb
decidim-elections-0.26.7 lib/decidim/elections/engine.rb
decidim-elections-0.26.5 lib/decidim/elections/engine.rb
decidim-elections-0.27.2 lib/decidim/elections/engine.rb
decidim-elections-0.27.1 lib/decidim/elections/engine.rb
decidim-elections-0.26.4 lib/decidim/elections/engine.rb
decidim-elections-0.27.0 lib/decidim/elections/engine.rb
decidim-elections-0.26.3 lib/decidim/elections/engine.rb
decidim-elections-0.27.0.rc2 lib/decidim/elections/engine.rb
decidim-elections-0.27.0.rc1 lib/decidim/elections/engine.rb
decidim-elections-0.26.2 lib/decidim/elections/engine.rb