Class: Decidim::Meetings::Polls::QuestionsController

Inherits:
ApplicationController show all
Includes:
Decidim::Meetings::PollsResources
Defined in:
decidim-meetings/app/controllers/decidim/meetings/polls/questions_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject


9
10
11
12
13
14
15
# File 'decidim-meetings/app/controllers/decidim/meetings/polls/questions_controller.rb', line 9

def index
  respond_to do |format|
    format.js do
      render template: pick_index_template, locals: { open_question: nil }
    end
  end
end

#updateObject


17
18
19
20
21
22
23
24
25
26
27
# File 'decidim-meetings/app/controllers/decidim/meetings/polls/questions_controller.rb', line 17

def update
  enforce_permission_to :update, :question, question: question

  Decidim::Meetings::Admin::UpdateQuestionStatus.call(question, current_user) do
    respond_to do |format|
      format.js do
        render template: admin_index_template, locals: { open_question: question.id }
      end
    end
  end
end