Replace render :nothing with head :ok

Using `render :nothing` was deprecated, but we never noticed it because
we didn't have a test for the action using it. In Rails 5.1, it raises
an exception.

Using `head :ok` and adding a test for this scenario solves the issue.
This commit is contained in:
Javi Martín
2020-04-15 15:00:32 +02:00
parent 6c0365d004
commit 37361a6f3d
2 changed files with 17 additions and 1 deletions

View File

@@ -44,7 +44,7 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController
def order_answers
::Poll::Question::Answer.order_answers(params[:ordered_list])
render nothing: true
head :ok
end
private