extracts recounting from admin's poll/show

This commit is contained in:
Juanjo Bazán
2017-02-14 14:07:22 +01:00
parent 19ec7f93b3
commit bedb9f29e7
10 changed files with 81 additions and 65 deletions

View File

@@ -8,9 +8,7 @@ class Admin::Poll::PollsController < Admin::BaseController
end
def show
@poll = Poll.includes(:questions,
booth_assignments: [:final_recounts,
:recounts]).
@poll = Poll.includes(:questions).
order('poll_questions.title').
find(params[:id])
end
@@ -46,7 +44,7 @@ class Admin::Poll::PollsController < Admin::BaseController
else
notice = t("admin.polls.flash.error_on_question_added")
end
redirect_to admin_poll_path(@poll, anchor: 'tab-questions'), notice: notice
redirect_to admin_poll_path(@poll), notice: notice
end
def remove_question
@@ -58,7 +56,7 @@ class Admin::Poll::PollsController < Admin::BaseController
else
notice = t("admin.polls.flash.error_on_question_removed")
end
redirect_to admin_poll_path(@poll, anchor: 'tab-questions'), notice: notice
redirect_to admin_poll_path(@poll), notice: notice
end
def search_questions