document url helper

This commit is contained in:
Konstantin Haase 2011-02-19 11:29:15 +01:00
parent ec25544ce4
commit ef54086552
1 changed files with 12 additions and 0 deletions

View File

@ -789,6 +789,18 @@ Similar to the body, you can also set the status code:
halt "I'm a tea pot!"
end
=== Generating URLs
For generating URLs you should use the `url` helper method, for instance, in
Haml:
%a{:href => url('/foo')} foo
It takes reverse proxies and Rack routers into account, if present.
This method is also aliased to `to` (see [below](#Browser%20Redirect) for an
example).
=== Browser Redirect
You can trigger a browser redirect with the `redirect` helper method: