In my controller I want to respond to an ajax request with an http 401 (unauthorized) error if the user is not logged in. However, the code below throws a 500 internal server error instead. Rails gives the error: "No Failure App Provided".
If I use other http error codes such as :bad_request (400) it works fine. The problem seems to only be with 401 error codes. Why is this?
if signed_in?
...
else
respond_to do |format|
format.html { head :unauthorized }
end
end