Remove useless answers show view
Until now, in order to edit an answer, we had to click on its title on the table and then on the "Edit answer" link. That was tedious and different from what we usually do in the admin section. Furthermore, the code for the answers table was written twice and when we modified it we forgot to update the one in the `show` action, meaning the table here provided less information than the information present in the answers tables. Co-Authored-By: Javi Martín <javim@elretirao.net>
This commit is contained in:
@@ -169,7 +169,7 @@ namespace :admin do
|
||||
end
|
||||
|
||||
resources :questions, shallow: true do
|
||||
resources :answers, except: [:index, :destroy], controller: "questions/answers", shallow: false
|
||||
resources :answers, except: [:index, :show, :destroy], controller: "questions/answers", shallow: false
|
||||
resources :answers, only: [], controller: "questions/answers" do
|
||||
resources :images, controller: "questions/answers/images"
|
||||
resources :videos, controller: "questions/answers/videos"
|
||||
@@ -323,6 +323,10 @@ resolve "Poll::Officer" do |officer, options|
|
||||
[:officer, options.merge(id: officer)]
|
||||
end
|
||||
|
||||
resolve "Poll::Question::Answer" do |answer, options|
|
||||
[:question, :answer, options.merge(question_id: answer.question, id: answer)]
|
||||
end
|
||||
|
||||
resolve "Poll::Question::Answer::Video" do |video, options|
|
||||
[:video, options.merge(id: video)]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user