Class: Decidim::Meetings::Polls::AnswersController
- Inherits:
-
ApplicationController
- Object
- Components::BaseController
- ApplicationController
- Decidim::Meetings::Polls::AnswersController
- Includes:
- Decidim::Meetings::PollsResources, FormFactory
- Defined in:
- app/controllers/decidim/meetings/polls/answers_controller.rb
Instance Method Summary collapse
Instance Method Details
#admin ⇒ Object
12 13 14 |
# File 'app/controllers/decidim/meetings/polls/answers_controller.rb', line 12 def admin (:update, :poll, meeting:) end |
#create ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/decidim/meetings/polls/answers_controller.rb', line 20 def create (:create, :answer, question:) @form = form(AnswerForm).from_params(params.merge(question:, current_user:)) CreateAnswer.call(@form, questionnaire) do # Both :ok and :invalid render the same template, because # validation errors are displayed in the template respond_to do |format| format.js end end end |
#index ⇒ Object
16 17 18 |
# File 'app/controllers/decidim/meetings/polls/answers_controller.rb', line 16 def index (:reply_poll, :meeting, meeting:) end |