For example when I get the error: 401
Unauthorized
, how can I include a json version in the respond with the html?
Something like this:
respond_to do |format|
format.html {
super
}
format.json {
render :json => 'sentence', :status => messages
}
end
I tried the devise_helper.rb
, but I couldn't get my head around how the html
is getting rendered.
I'm not looking for editing the Devise Views. This Q&A does not really the answer my question, the answer there is for generating and customizing views. I'm looking for custom controller callback messages with json. I also know that the messages can be changed in the devise yaml, but I need the return in json with html both :/