Saturday, 3 February 2018

Completed 406 Not Acceptable with Devise

I had some trouble after an update of ruby/rails/gems on a something I hadn't worked on for ages. When register a user with Devise it would error with a Completed 406 Not Acceptable with Devise
As usual Stack Overflow came to the rescue, where I found this: "Devise responding to json by default has been removed from version 2.2" The fix was simple, I added this to my confif/application.rb and everything was working fine again:

config.to_prepare do
      DeviseController.respond_to :html, :json
    end

No comments:

Post a Comment

Comments are moderated, so you'll have to wait a little bit before they appear!