aboutsummaryrefslogtreecommitdiff
path: root/www/rubygem-emk-sinatra-url-for/pkg-descr
blob: 468bf2b8199fd12406efefd88dfeecfe1e9ce016 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
sinatra-url-for constructs absolute paths and full URLs for
handlers in a Sinatra application. Assuming that your application
is running on example.com, and that it has been mapped to /myapp,
you should be able call url_for from within a handler as follows:

  url_for "/"            # Returns "/myapp/"
  url_for "/foo"         # Returns "/myapp/foo"
  url_for "/foo", :full  # Returns "http://example.com/myapp/foo"

WWW: https://github.com/emk/sinatra-url-for