Hi,
I had an issue with my angular + rails app, where after upgrading to rails 4.2 Devise stopped responding to JSON.
After some research/debugging I have fixed that by adding
config.navigational_formats = ['*/*', :html, :json]
in initializers/devise.rb
However, I have seen many blog posts / SO answers and none mentions this approach. People recommend vairous things such as:
config.to_prepare do
DeviseController.respond_to :html, :json
end
or
class RegistrationsController < Devise::RegistrationsController
respond_to :json
end
and the like.
Questions:
Your code is not teaching Devise how to handle JSON. In fact, it is sending
the wrong information because JSON is not a navigational format.
_Jos茅 Valim_
www.plataformatec.com.br
Skype: jv.ptec
Founder and Lead Developer
The two mentioned solutions are fine, but you can simply call respond_to in your application controller. In any case, please use the mailing list or StackOverflow for questions/help, where a wider community will be able to help you. We reserve the issues tracker for issues only.
Yep, I realized my mistake shortly after. Thanks anyways!
What is the solution, facing the same issue...
this blogpost worked for me.
@bikezilla This blog works for me
Most helpful comment
this blogpost worked for me.