Sha256: 11ffe26c223419a30a10d1982cb8a27d45bc20518c94fb5d20b676f3029c25b7
Contents?: true
Size: 1.18 KB
Versions: 31
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true module Decidim module Meetings module Polls class QuestionsController < Decidim::Meetings::ApplicationController include Decidim::Meetings::PollsResources def index respond_to do |format| format.js do render template: pick_index_template, locals: { open_question: nil } end end end 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 private def question @question ||= questionnaire.questions.find(params[:id]) if questionnaire end def admin_index_template "decidim/meetings/polls/questions/index_admin" end def pick_index_template params[:admin] ? admin_index_template : "decidim/meetings/polls/questions/index" end end end end end
Version data entries
31 entries across 31 versions & 1 rubygems