Class: Decidim::Elections::TrusteeZone::ElectionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/decidim/elections/trustee_zone/elections_controller.rb

Overview

Handles the KeyCeremony for trustee users

Instance Method Summary collapse

Instance Method Details

#showObject



10
11
12
# File 'app/controllers/decidim/elections/trustee_zone/elections_controller.rb', line 10

def show
  enforce_permission_to :view, :election, trustee: trustee
end

#updateObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/decidim/elections/trustee_zone/elections_controller.rb', line 14

def update
  enforce_permission_to :update, :election, trustee: trustee

  UpdateElectionBulletinBoardStatus.call(election, params[:status]) do
    on(:ok) do
      render :update
    end
    on(:invalid) do
      flash[:alert] = I18n.t("elections.update.error", scope: "decidim.elections.trustee_zone")
    end
  end
end