Rails render html not json when an exception is thrown
I hope someone can help with this problem.
I have a web services application that I am writing in rails. I am using RocketPants for services and Authority for authorization.
I'm having an exception handling issue where the "now resolvable" permission exception (Authority :: SecurityViolation) is rendered as HTML instead of JSON.
I have documented the story in this sense and this question .
I can replicate by throwing an exception in my ApiController for example raise "blah"
and get an html error page. I tried using rescue_from
as in this question with the same unfortunate result.
I don't know where from here. Does anyone know of anything on the Rails exception handling stack that causes this? I would appreciate any help.
source to share