1

I am getting the following error

DEPRECATION WARNING: The :status option on `head` has been deprecated and will be removed in Rails 5.1. Please pass the status as a separate parameter before the options, instead.

It's used in the following context:

def options
    head :status => 200, :'Access-Control-Allow-Headers' =>
    'accept, content-type, Authorization, cache-control, x-requested-with'
  end

The app uses devise for authentication, so I am suspecting this code came along with that. Any suggestion on how to re-write this?

Suthan Bala
  • 3,209
  • 5
  • 34
  • 59

1 Answers1

1

The warning sais 'Please pass the status as a separate parameter before the options, instead.'

which would look like

head 200

or more descriptive

head :ok

See here for a more detailed answer: The ":nothing" option is deprecated and will be removed in Rails 5.1

Community
  • 1
  • 1
VinVan
  • 23
  • 6