Browse files

README: Edit for clarity

  • Loading branch information...
1 parent 74f884d commit 1df339284203f8f6ed8dc600d9c4695c7d15e45c @emk committed Apr 22, 2009
Showing with 10 additions and 12 deletions.
  1. +10 −12 README.rdoc
View
22 README.rdoc
@@ -1,7 +1,14 @@
= sinatra-url-for
-<code>sinatra-url-for</code> can be used by a Sinatra application to
-construct absolute paths and full URLs.
+<code>sinatra-url-for</code> constructs absolute paths and full URLs for
+handlers in a Sinatra application. Assuming that your application is
+running on <code>example.com</code>, and that it has been mapped to
+<code>/myapp</code>, 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"
To install it, run:
@@ -13,15 +20,6 @@ To include it in a Sinatra application, write:
gem 'emk-sinatra-url-for'
require 'sinatra/url_for'
-Once this is done, you should be able to call +url_for+ from within a
-request. Assuming that your application is running on
-<code>example.com</code>, and that it has been mapped to
-<code>/myapp</code>, you should get:
-
- url_for "/" # Returns "/myapp/"
- url_for "/foo" # Returns "/myapp/foo"
- url_for "/foo", :full # Returns "http://example.com/myapp/foo"
-
If you're subclassing <code>Sinatra::Base</code>, then you need to call
<code>helpers</code> manually:
@@ -31,7 +29,7 @@ If you're subclassing <code>Sinatra::Base</code>, then you need to call
end
Thanks to "cypher23" on #mephisto and the folks on #rack for pointing me in
-the right direction. If this gem fails to work correctly on your web
+the right direction. If this gem fails to work correctly on your
system, please feel free to submit patches and/or bug reports!
== Copyright

0 comments on commit 1df3392

Please sign in to comment.