Difference between `redirect` and `redirect to` in Sinatra
ruby, sinatra
Solution
The `redirect` method sends the HTTP header to redirect the client to a given URL, and the argument passed should be a fully qualified URL with a host (e.g. `http://example.com/path`, not just `/path`).
The `to` method converts a path to a full URL for your Sinatra app, allowing the resulting URL to be used in `redirect`. E.g. `to('/path')` would become `http://yoursinatraapp/path`.
Problem
What is the difference between using `redirect` and `redirect to` in Sinatra? They both seem to default to the same status code. Is the `to '/url'` bit just some syntactic niceness to make the method more readable?