Skip to content

Commit

Permalink
Add documentation for the mount method in ActionDispatch's Mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Nov 13, 2010
1 parent b591989 commit b235519
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions actionpack/lib/action_dispatch/routing/mapper.rb
Expand Up @@ -262,6 +262,23 @@ def match(path, options=nil)
self
end

# Mount a Rack-based application to be used within the application.
#
# mount SomeRackApp, :at => "some_route"
#
# Alternatively:
#
# mount(SomeRackApp => "some_route")
#
# All mounted applications come with routing helpers to access them.
# These are named after the class specified, so for the above example
# the helper is either +some_rack_app_path+ or +some_rack_app_url+.
# To customize this helper's name, use the +:as+ option:
#
# mount(SomeRackApp => "some_route", :as => "exciting")
#
# This will generate the +exciting_path+ and +exciting_url+ helpers
# which can be used to navigate to this mounted app.
def mount(app, options = nil)
if options
path = options.delete(:at)
Expand Down

0 comments on commit b235519

Please sign in to comment.