Module | Sinatra::UrlForHelper |
In: |
lib/sinatra/url_for.rb
|
Construct a link to url_fragment, which should be given relative to the base of this Sinatra app. The mode should be either :path_only, which will generate an absolute path within the current domain (the default), or :full, which will include the site name and port number. (The latter is typically necessary for links in RSS feeds.) Example usage:
url_for "/" # Returns "/myapp/" url_for "/foo" # Returns "/myapp/foo" url_for "/foo", :full # Returns "http://example.com/myapp/foo"