From a2932784bb71e72a78c32819ebd7ed2bed551e3e Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sun, 5 Oct 2008 22:16:26 +0100 Subject: Merge docrails --- actionpack/lib/action_controller/base.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_controller/base.rb') diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index e99e828730..413f6d48e5 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -252,7 +252,7 @@ module ActionController #:nodoc: # # def do_something # redirect_to(:action => "elsewhere") and return if monkeys.nil? - # render :action => "overthere" # won't be called unless monkeys is nil + # render :action => "overthere" # won't be called if monkeys is nil # end # class Base @@ -542,8 +542,8 @@ module ActionController #:nodoc: response end - # Returns a URL that has been rewritten according to the options hash and the defined Routes. - # (For doing a complete redirect, use redirect_to). + # Returns a URL that has been rewritten according to the options hash and the defined routes. + # (For doing a complete redirect, use +redirect_to+). # # url_for is used to: # @@ -583,7 +583,15 @@ module ActionController #:nodoc: # missing values in the current request's parameters. Routes attempts to guess when a value should and should not be # taken from the defaults. There are a few simple rules on how this is performed: # - # * If the controller name begins with a slash, no defaults are used: url_for :controller => '/home' + # * If the controller name begins with a slash no defaults are used: + # + # url_for :controller => '/home' + # + # In particular, a leading slash ensures no namespace is assumed. Thus, + # while url_for :controller => 'users' may resolve to + # Admin::UsersController if the current controller lives under + # that module, url_for :controller => '/users' ensures you link + # to ::UsersController no matter what. # * If the controller changes, the action will default to index unless provided # # The final rule is applied while the URL is being generated and is best illustrated by an example. Let us consider the -- cgit v1.2.3