aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/new_base/http.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/new_base/http.rb')
-rw-r--r--actionpack/lib/action_controller/new_base/http.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/new_base/http.rb b/actionpack/lib/action_controller/new_base/http.rb
index f663900944..b7e3bfaa7e 100644
--- a/actionpack/lib/action_controller/new_base/http.rb
+++ b/actionpack/lib/action_controller/new_base/http.rb
@@ -39,13 +39,20 @@ module ActionController
end
# :api: private
- def call(env)
+ def call(name, env)
@_request = ActionDispatch::Request.new(env)
@_response = ActionDispatch::Response.new
- process(@_request.parameters[:action])
+ process(name)
@_response.body = response_body
@_response.prepare!
- self
+ to_rack
+ end
+
+ def self.action(name)
+ @actions ||= {}
+ @actions[name] ||= proc do |env|
+ new.call(name, env)
+ end
end
# :api: private