aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorNick Sutterer <apotonick@gmail.com>2011-05-12 09:58:26 +0200
committerNick Sutterer <apotonick@gmail.com>2011-05-12 09:58:26 +0200
commite1ceae576e3911f3e6708b5d19a0e3ef63769eb7 (patch)
tree2fd6d36b7d50aa16170544a0d64a4cbdd87a8736 /actionpack
parente3b3f416b57f5642ea25078485f7e9394ad04526 (diff)
downloadrails-e1ceae576e3911f3e6708b5d19a0e3ef63769eb7.tar.gz
rails-e1ceae576e3911f3e6708b5d19a0e3ef63769eb7.tar.bz2
rails-e1ceae576e3911f3e6708b5d19a0e3ef63769eb7.zip
added an example for AC::UrlFor usage to make usage simpler.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/metal/url_for.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/url_for.rb b/actionpack/lib/action_controller/metal/url_for.rb
index 9a03033f48..a185d799bf 100644
--- a/actionpack/lib/action_controller/metal/url_for.rb
+++ b/actionpack/lib/action_controller/metal/url_for.rb
@@ -3,7 +3,19 @@
#
# In addition to AbstractController::UrlFor, this module accesses the HTTP layer to define
# url options like the +host+. In order to do so, this module requires the host class
-# to implement #env, which needs to be a Rack-compatible environment hash.
+# to implement #env and #request, which need to be a Rack-compatible.
+#
+# Example:
+#
+# class RootUrl
+# include ActionController::UrlFor
+# include Rails.application.routes.url_helpers
+# delegate :env, :request, :to => :controller
+#
+# def initialize(controller)
+# @controller = controller
+# @url = root_path # named route from the application.
+# end
module ActionController
module UrlFor
extend ActiveSupport::Concern