Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The ":nothing" option is deprecated and will be removed in Rails 5.1

According to the rails source, this is done under the hood when passing nothing: true in rails 5.

if options.delete(:nothing)
  ActiveSupport::Deprecation.warn("`:nothing` option is deprecated and will be removed in Rails 5.1. Use `head` method to respond with empty response body.")
  options[:body] = nil
end

Just replacing nothing: true with body: nil should therefore solve the problem.

class PagesController < ApplicationController
  def action
    render body: nil
  end
end

alternatively you can use head :ok

class PagesController < ApplicationController
  def action
    head :ok
  end
end