From 7eb09aed874dbb5f50a9ac0d0dec22e42f6161be Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Sun, 20 May 2012 00:50:22 +0200 Subject: Update documentation for AbstractController::Base --- actionpack/lib/abstract_controller/base.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/abstract_controller') diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb index 97a9eec144..32ec7ced0f 100644 --- a/actionpack/lib/abstract_controller/base.rb +++ b/actionpack/lib/abstract_controller/base.rb @@ -51,7 +51,7 @@ module AbstractController # to specify particular actions as hidden. # # ==== Returns - # * array - An array of method names that should not be considered actions. + # * Array - An array of method names that should not be considered actions. def hidden_actions [] end @@ -63,7 +63,7 @@ module AbstractController # itself. Finally, #hidden_actions are removed. # # ==== Returns - # * set - A set of all methods that should be considered actions. + # * Set - A set of all methods that should be considered actions. def action_methods @action_methods ||= begin # All public instance methods of this class, including ancestors @@ -92,11 +92,12 @@ module AbstractController # controller_path. # # ==== Returns - # * string + # * String def controller_path @controller_path ||= name.sub(/Controller$/, '').underscore unless anonymous? end + # Refresh the cached action_methods when a new action_method is added. def method_added(name) super clear_action_methods! @@ -130,6 +131,7 @@ module AbstractController self.class.controller_path end + # Delegates to the class' #action_methods def action_methods self.class.action_methods end @@ -141,6 +143,12 @@ module AbstractController # false and available_action?("foo") returns true because # available action consider actions that are also available # through other means, for example, implicit render ones. + # + # ==== Parameters + # * action_name - The name of an action to be tested + # + # ==== Returns + # * TrueClass, FalseClass def available_action?(action_name) method_for_action(action_name).present? end -- cgit v1.2.3 From fa6d921e11363e9b8c4bc10f7aed0b9faffdc33a Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Sun, 20 May 2012 01:29:13 +0200 Subject: Remove blank trailing comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For future reference, this is the regex I used: ^\s*#\s*\n(?!\s*#). Replace with the first match, and voilĂ ! Note that the regex matches a little bit too much, so you probably want to `git add -i .` and go through every single diff to check if it actually should be changed. --- actionpack/lib/abstract_controller/helpers.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'actionpack/lib/abstract_controller') diff --git a/actionpack/lib/abstract_controller/helpers.rb b/actionpack/lib/abstract_controller/helpers.rb index 4e0672d590..529f920e6c 100644 --- a/actionpack/lib/abstract_controller/helpers.rb +++ b/actionpack/lib/abstract_controller/helpers.rb @@ -90,7 +90,6 @@ module AbstractController # +symbols+, +strings+, +modules+ and blocks. # # helper(:three, BlindHelper) { def mice() 'mice' end } - # def helper(*args, &block) modules_for_helpers(args).each do |mod| add_template_helper(mod) -- cgit v1.2.3 From 2642c2961cda2074cc1495a4635898ca8ab33adf Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 23 May 2012 22:42:49 +0530 Subject: copy edit[ci skip] --- actionpack/lib/abstract_controller/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/abstract_controller') diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb index 32ec7ced0f..9c3960961b 100644 --- a/actionpack/lib/abstract_controller/base.rb +++ b/actionpack/lib/abstract_controller/base.rb @@ -141,7 +141,7 @@ module AbstractController # # Notice that action_methods.include?("foo") may return # false and available_action?("foo") returns true because - # available action consider actions that are also available + # this method considers actions that are also available # through other means, for example, implicit render ones. # # ==== Parameters -- cgit v1.2.3 From 1ad0b378cc081937c117577ab628f2160fcc448d Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 23 May 2012 22:43:08 +0530 Subject: Revert "Remove blank trailing comments" This reverts commit fa6d921e11363e9b8c4bc10f7aed0b9faffdc33a. Reason: Not a fan of such massive changes. We usually close such changes if made to Rails master as a pull request. Following the same principle here and reverting. [ci skip] --- actionpack/lib/abstract_controller/helpers.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/lib/abstract_controller') diff --git a/actionpack/lib/abstract_controller/helpers.rb b/actionpack/lib/abstract_controller/helpers.rb index 529f920e6c..4e0672d590 100644 --- a/actionpack/lib/abstract_controller/helpers.rb +++ b/actionpack/lib/abstract_controller/helpers.rb @@ -90,6 +90,7 @@ module AbstractController # +symbols+, +strings+, +modules+ and blocks. # # helper(:three, BlindHelper) { def mice() 'mice' end } + # def helper(*args, &block) modules_for_helpers(args).each do |mod| add_template_helper(mod) -- cgit v1.2.3