Sha256: 7840e5c936ff6792a1f7a5ecb975be1b67289ea858a368b7059b7f742aa0d545

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

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

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

      routes do
        resources :documents do
          collection do
            get :pdf_viewer
            get :edit_pdf
          end
          member do
            put :publish
          end
          resources :annotations, except: [:show, :new, :edit]
          resources :sections, except: [:show, :index]
          resources :suggestions, only: [:index, :show] do
            resources :valuation_assignments, only: [:destroy]
            collection do
              post :publish_answers
              resource :valuation_assignment, only: [:create, :destroy]
            end

            member do
              patch :answer
            end
            resources :suggestion_notes, only: [:create, :edit, :update]
          end
        end

        root to: "documents#index"
      end

      def load_seed
        nil
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-participatory_documents-0.2.2 lib/decidim/participatory_documents/admin_engine.rb
decidim-participatory_documents-0.2.1 lib/decidim/participatory_documents/admin_engine.rb
decidim-participatory_documents-0.2.0 lib/decidim/participatory_documents/admin_engine.rb