Im trying to return a custom HTTP response, based on condition I want to return true or false, the right response is calculated in my /api/validate function
Have tried nummerous things all fail. How to just return true or false?
Your can not return just true or false. You have to return correct http response with status code. For example
200 OK – true 422 Unprocessable Entity – falseOr you can always return 200 OK with hash object converted to JSON in body of your response. Something like
{ :result => true }.to_json