I can't really get my head around it. Let's say I have a controller as follows:
get :test do
status 201
body "test"
end
after do
status 404
body "not found"
end
Now, visiting /test produces response with status 404 and body "test". How do I do this properly?
Also, I noticed I can omit body like
get :test do
status 201
"test"
end
and the response stays the same, but calling response.body later returns empty array instead of the actual content. Why is this so confusing, is that some kind of inconsistency between Padrino and Sinatra? What am I missing here, anyone care to explain?