aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/routing/optimisations.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2008-05-02 14:45:23 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-05-02 14:45:23 +0100
commit64092de25727c1943807bf5345107d90428135a0 (patch)
tree87977e3b0c839fb6adb417949676bb5384155526 /actionpack/lib/action_controller/routing/optimisations.rb
parent87ec72bd8c4b5d178ba7a41e605bc9a8e27f9e67 (diff)
downloadrails-64092de25727c1943807bf5345107d90428135a0.tar.gz
rails-64092de25727c1943807bf5345107d90428135a0.tar.bz2
rails-64092de25727c1943807bf5345107d90428135a0.zip
Improve documentation coverage and markup
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/lib/action_controller/routing/optimisations.rb')
-rw-r--r--actionpack/lib/action_controller/routing/optimisations.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/routing/optimisations.rb b/actionpack/lib/action_controller/routing/optimisations.rb
index ba4aeb4e82..534cf10315 100644
--- a/actionpack/lib/action_controller/routing/optimisations.rb
+++ b/actionpack/lib/action_controller/routing/optimisations.rb
@@ -1,11 +1,11 @@
module ActionController
module Routing
# Much of the slow performance from routes comes from the
- # complexity of expiry, :requirements matching, defaults providing
+ # complexity of expiry, <tt>:requirements</tt> matching, defaults providing
# and figuring out which url pattern to use. With named routes
# we can avoid the expense of finding the right route. So if
# they've provided the right number of arguments, and have no
- # :requirements, we can just build up a string and return it.
+ # <tt>:requirements</tt>, we can just build up a string and return it.
#
# To support building optimisations for other common cases, the
# generation code is separated into several classes
@@ -41,19 +41,20 @@ module ActionController
end
end
- # Temporarily disabled :url optimisation pending proper solution to
+ # Temporarily disabled <tt>:url</tt> optimisation pending proper solution to
# Issues around request.host etc.
def applicable?
true
end
end
- # Given a route:
- # map.person '/people/:id'
+ # Given a route
#
- # If the user calls person_url(@person), we can simply
+ # map.person '/people/:id'
+ #
+ # If the user calls <tt>person_url(@person)</tt>, we can simply
# return a string like "/people/#{@person.to_param}"
- # rather than triggering the expensive logic in url_for
+ # rather than triggering the expensive logic in +url_for+.
class PositionalArguments < Optimiser
def guard_condition
number_of_arguments = route.segment_keys.size
@@ -77,7 +78,7 @@ module ActionController
elements << '#{request.relative_url_root if request.relative_url_root}'
- # The last entry in route.segments appears to # *always* be a
+ # The last entry in <tt>route.segments</tt> appears to *always* be a
# 'divider segment' for '/' but we have assertions to ensure that
# we don't include the trailing slashes, so skip them.
(route.segments.size == 1 ? route.segments : route.segments[0..-2]).each do |segment|
@@ -106,7 +107,7 @@ module ActionController
super.insert(-2, '?#{args.last.to_query}')
end
- # To avoid generating http://localhost/?host=foo.example.com we
+ # To avoid generating "http://localhost/?host=foo.example.com" we
# can't use this optimisation on routes without any segments
def applicable?
super && route.segment_keys.size > 0