Class: Decidim::Budgets::Admin::AttachmentsController

Inherits:
ApplicationController
  • Object
show all
Includes:
Admin::Concerns::HasAttachments
Defined in:
app/controllers/decidim/budgets/admin/attachments_controller.rb

Overview

Controller that allows managing all the attachments for a participatory process.

Instance Method Summary collapse

Methods inherited from ApplicationController

#budget, #maps_enabled?

Instance Method Details

#after_destroy_pathObject



12
13
14
# File 'app/controllers/decidim/budgets/admin/attachments_controller.rb', line 12

def after_destroy_path
  budget_projects_path(project.budget)
end

#attached_toObject



16
17
18
# File 'app/controllers/decidim/budgets/admin/attachments_controller.rb', line 16

def attached_to
  project
end

#projectObject



24
25
26
# File 'app/controllers/decidim/budgets/admin/attachments_controller.rb', line 24

def project
  @project ||= projects.find(params[:project_id])
end

#projectsObject



20
21
22
# File 'app/controllers/decidim/budgets/admin/attachments_controller.rb', line 20

def projects
  @projects ||= Decidim::Budgets::Project.joins(:budget).where(budget: { component: current_component })
end