I'm a programmer specialising in performant and scalable systems using PHP and Ruby and cooking

On Ruby | Rails | API

Rails return codes

When using the head method to return a status code only result, take care not to get caught in the same trap I did with using the wrong status code.

If you want to return a 200 result you would use

head :ok  

I got caught out because using:

head :success  

whilst seeming logical, actually returns a 500 with no errors.