diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-14 17:25:10 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-14 17:25:10 -0700 |
commit | da65320433088548bc4cff33758e5acd71fd137a (patch) | |
tree | 97a5b945c5fece6da744383fda42072b3296988e /actionpack/lib/action_controller/new_base | |
parent | 8fac2c88cae0f2fd42fad3c2c2c6c860df14d629 (diff) | |
download | rails-da65320433088548bc4cff33758e5acd71fd137a.tar.gz rails-da65320433088548bc4cff33758e5acd71fd137a.tar.bz2 rails-da65320433088548bc4cff33758e5acd71fd137a.zip |
Got new base to pass controller/base_test.rb, implemented method_missing action semantics in compatibility mode, and fixed a few action_missing bugs.
Diffstat (limited to 'actionpack/lib/action_controller/new_base')
3 files changed, 17 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/new_base/compatibility.rb b/actionpack/lib/action_controller/new_base/compatibility.rb index d17f498b60..993e571aba 100644 --- a/actionpack/lib/action_controller/new_base/compatibility.rb +++ b/actionpack/lib/action_controller/new_base/compatibility.rb @@ -42,6 +42,9 @@ module ActionController # Controls the resource action separator cattr_accessor :resource_action_separator self.resource_action_separator = "/" + + cattr_accessor :use_accept_header + self.use_accept_header = true end module ClassMethods @@ -66,6 +69,18 @@ module ActionController super end + + def respond_to_action?(action_name) + if respond_to?(:method_missing) && !respond_to?(:action_missing) + self.class.class_eval do + private + def action_missing(name, *args) + method_missing(name.to_sym, *args) + end + end + end + super + end def _layout_for_name(name) name &&= name.sub(%r{^/?layouts/}, '') diff --git a/actionpack/lib/action_controller/new_base/hide_actions.rb b/actionpack/lib/action_controller/new_base/hide_actions.rb index d1857a9169..a29b09a893 100644 --- a/actionpack/lib/action_controller/new_base/hide_actions.rb +++ b/actionpack/lib/action_controller/new_base/hide_actions.rb @@ -12,8 +12,8 @@ module ActionController private - def respond_to_action?(action_name) - !hidden_actions.include?(action_name) && (super || respond_to?(:method_missing)) + def action_method?(action_name) + !hidden_actions.include?(action_name) && super end module ClassMethods diff --git a/actionpack/lib/action_controller/new_base/http.rb b/actionpack/lib/action_controller/new_base/http.rb index fb6041a04e..f3a60b3bf8 100644 --- a/actionpack/lib/action_controller/new_base/http.rb +++ b/actionpack/lib/action_controller/new_base/http.rb @@ -21,11 +21,6 @@ module ActionController # :api: public def controller_path() self.class.controller_path end - # :api: private - def self.internal_methods - ActionController::Http.public_instance_methods(true) - end - # :api: private def self.action_names() action_methods end |