aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/abstract_controller/base.rb
diff options
context:
space:
mode:
authorclaudiob <claudiob@gmail.com>2014-12-19 12:49:50 -0800
committerclaudiob <claudiob@gmail.com>2014-12-22 03:53:48 +0100
commitbea61d66708d293ee75733ddd912dc1331fa1834 (patch)
tree3c9af375645b3ed8f9bb16a54830b1f7681250ad /actionpack/lib/abstract_controller/base.rb
parenta770d7e404f994d717843035eba9c1094a6e90d8 (diff)
downloadrails-bea61d66708d293ee75733ddd912dc1331fa1834.tar.gz
rails-bea61d66708d293ee75733ddd912dc1331fa1834.tar.bz2
rails-bea61d66708d293ee75733ddd912dc1331fa1834.zip
Better docs for AbstractController
Fixes internal links, adds examples and set fixed-width fonts. [ci skip]
Diffstat (limited to 'actionpack/lib/abstract_controller/base.rb')
-rw-r--r--actionpack/lib/abstract_controller/base.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb
index 51c661f735..2c8a67db09 100644
--- a/actionpack/lib/abstract_controller/base.rb
+++ b/actionpack/lib/abstract_controller/base.rb
@@ -12,7 +12,7 @@ module AbstractController
class ActionNotFound < StandardError
end
- # <tt>AbstractController::Base</tt> is a low-level API. Nobody should be
+ # AbstractController::Base is a low-level API. Nobody should be
# using it directly, and subclasses (like ActionController::Base) are
# expected to provide their own +render+ method, since rendering means
# different things depending on the context.
@@ -69,9 +69,9 @@ module AbstractController
# A list of method names that should be considered actions. This
# includes all public instance methods on a controller, less
- # any internal methods (see #internal_methods), adding back in
+ # any internal methods (see internal_methods), adding back in
# any methods that are internal, but still exist on the class
- # itself. Finally, #hidden_actions are removed.
+ # itself. Finally, hidden_actions are removed.
#
# ==== Returns
# * <tt>Set</tt> - A set of all methods that should be considered actions.
@@ -92,15 +92,19 @@ module AbstractController
end
# action_methods are cached and there is sometimes need to refresh
- # them. clear_action_methods! allows you to do that, so next time
+ # them. ::clear_action_methods! allows you to do that, so next time
# you run action_methods, they will be recalculated
def clear_action_methods!
@action_methods = nil
end
# Returns the full controller name, underscored, without the ending Controller.
- # For instance, MyApp::MyPostsController would return "my_app/my_posts" for
- # controller_path.
+ #
+ # class MyApp
+ # MyPostsController < AbstractController::Base
+ # end
+ # end
+ # MyApp::MyPostsController.controller_path # => "my_app/my_posts"
#
# ==== Returns
# * <tt>String</tt>
@@ -137,12 +141,12 @@ module AbstractController
process_action(action_name, *args)
end
- # Delegates to the class' #controller_path
+ # Delegates to the class' ::controller_path
def controller_path
self.class.controller_path
end
- # Delegates to the class' #action_methods
+ # Delegates to the class' ::action_methods
def action_methods
self.class.action_methods
end