Implements answering questions

This commit is contained in:
kikito
2016-11-14 13:36:00 +01:00
parent 598b1b9c01
commit 1f9945d0aa
6 changed files with 9 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
class Polls::QuestionsController < ApplicationController
load_and_authorize_resource :poll
load_and_authorize_resource :question, through: :poll
load_and_authorize_resource :question, class: 'Poll::Question', through: :poll
def answer
partial_result = @question.partial_results.find_or_initialize_by(author: current_user,