Polls admin fixes

Removed search from questions tab and unassign button.
This commit is contained in:
María Checa
2017-10-02 10:37:10 +02:00
parent fd1d09c8c2
commit adf18ee756
4 changed files with 0 additions and 18 deletions

View File

@@ -47,18 +47,6 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController
redirect_to admin_poll_path(@poll), notice: notice redirect_to admin_poll_path(@poll), notice: notice
end end
def remove_question
question = ::Poll::Question.find(params[:question_id])
if @poll.questions.include? question
@poll.questions.delete(question)
notice = t("admin.polls.flash.question_removed")
else
notice = t("admin.polls.flash.error_on_question_removed")
end
redirect_to admin_poll_path(@poll), notice: notice
end
def search_questions def search_questions
@questions = ::Poll::Question.where("poll_id IS ? OR poll_id != ?", nil, @poll.id).search(search: @search).order(title: :asc) @questions = ::Poll::Question.where("poll_id IS ? OR poll_id != ?", nil, @poll.id).search(search: @search).order(title: :asc)
respond_to do |format| respond_to do |format|

View File

@@ -20,10 +20,6 @@
</strong> </strong>
</td> </td>
<td class="text-right"> <td class="text-right">
<%= link_to t('admin.polls.show.remove_question'),
remove_question_admin_poll_path(poll_id: @poll.id, question_id: question.id),
class: "button hollow alert",
method: :patch %>
</td> </td>
</tr> </tr>
<% end %> <% end %>

View File

@@ -3,6 +3,5 @@
<div id="poll-resources"> <div id="poll-resources">
<%= render "subnav" %> <%= render "subnav" %>
<%= render "search_questions" %>
<%= render "questions" %> <%= render "questions" %>
</div> </div>

View File

@@ -275,7 +275,6 @@ Rails.application.routes.draw do
resources :polls do resources :polls do
get :search_questions, on: :member get :search_questions, on: :member
patch :add_question, on: :member patch :add_question, on: :member
patch :remove_question, on: :member
resources :booth_assignments, only: [:index, :show, :create, :destroy] do resources :booth_assignments, only: [:index, :show, :create, :destroy] do
get :search_booths, on: :collection get :search_booths, on: :collection