HEAD response in padrino
With Ruby on Rails we can give HEAD
response in a controller action easily
def index
# some code
head status: 201
end
With Padrino there's no head
method, but we can as easily return HEAD
response
get '/'
# some code
[204, {}, ['']]
end
That is in sequence, the response status, the headers hash, and the body. It's just a standard rack response object.
Written by Rahmat Budiharso
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#