0

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 :/

Community
  • 1
  • 1
0bserver07
  • 3,390
  • 1
  • 28
  • 56
  • possible duplicate of [Customizing Devise views in Rails](http://stackoverflow.com/questions/6646845/customizing-devise-views-in-rails) – max May 20 '15 at 16:06
  • @papirtiger not really the answer in that question is for generating and customizing views. I'm looking for custom controller callback messages with json. Also the message can be changed in the devise yaml, but I need the return in json with html both :/ – 0bserver07 May 20 '15 at 16:16

0 Answers0