This looks like a solution: sinatra-respond_to