Sha256: bde4141bb31a32f60334451cc7bd0280f21ff5f7ef0734cc670c5a73371f628a

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

module Decidim
  module ActionDelegator
    # This is the engine that runs on the public interface of `ActionDelegator`.
    class AdminEngine < ::Rails::Engine
      isolate_namespace Decidim::ActionDelegator::Admin

      paths["db/migrate"] = nil
      paths["lib/tasks"] = nil

      routes do
        resources :settings, only: [:index, :new, :create, :destroy] do
          resources :delegations, only: [:index, :new, :create, :destroy]
        end

        resources :consultations, param: :slug, only: [] do
          get :results, on: :member
          resources :exports, only: [:create], module: :consultations

          namespace :exports do
            resources :sum_of_weights, only: :create
          end

          namespace :results do
            resources :sum_of_weights, only: :index
          end
        end

        root to: "delegations#index"
      end

      initializer "decidim_action_delegator.admin_assets" do |app|
        app.config.assets.precompile += %w(admin/decidim_action_delegator_manifest.js admin/decidim_action_delegator_manifest.css)
      end

      def load_seed
        nil
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
decidim-action_delegator-0.4.1 lib/decidim/action_delegator/admin_engine.rb
decidim-action_delegator-0.4 lib/decidim/action_delegator/admin_engine.rb