Skip to content

Commit

Permalink
added an example for AC::UrlFor usage to make usage simpler.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed May 12, 2011
1 parent e3b3f41 commit e1ceae5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion actionpack/lib/action_controller/metal/url_for.rb
Expand Up @@ -3,7 +3,19 @@
# #
# In addition to AbstractController::UrlFor, this module accesses the HTTP layer to define # 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 # 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 ActionController
module UrlFor module UrlFor
extend ActiveSupport::Concern extend ActiveSupport::Concern
Expand Down

0 comments on commit e1ceae5

Please sign in to comment.