aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/metal.rb')
-rw-r--r--actionpack/lib/action_controller/metal.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb
index 775a5002e2..2281c500c5 100644
--- a/actionpack/lib/action_controller/metal.rb
+++ b/actionpack/lib/action_controller/metal.rb
@@ -52,8 +52,7 @@ module ActionController
class Metal < AbstractController::Base
abstract!
- # :api: public
- attr_internal :params, :env
+ attr_internal :env
# Returns the last part of the controller's name, underscored, without the ending
# "Controller". For instance, MyApp::MyPostsController would return "my_posts" for
@@ -62,7 +61,7 @@ module ActionController
# ==== Returns
# String
def self.controller_name
- @controller_name ||= controller_path.split("/").last
+ @controller_name ||= self.name.demodulize.sub(/Controller$/, '').underscore
end
# Delegates to the class' #controller_name
@@ -85,6 +84,14 @@ module ActionController
super
end
+ def params
+ @_params ||= request.parameters
+ end
+
+ def params=(val)
+ @_params = val
+ end
+
# Basic implementations for content_type=, location=, and headers are
# provided to reduce the dependency on the RackDelegation module
# in Renderer and Redirector.