diff options
author | Alexey Vakhov <vakhov@gmail.com> | 2011-10-11 12:48:03 +0400 |
---|---|---|
committer | Alexey Vakhov <vakhov@gmail.com> | 2011-10-11 12:48:03 +0400 |
commit | 50d262f52ab39680b031e485b89b64875c08358e (patch) | |
tree | 3aea716cf7f577e9b0395f440b901f786b912879 | |
parent | 1735868c61bc9925f8fabdaea4c44e4b5962b8f4 (diff) | |
download | rails-50d262f52ab39680b031e485b89b64875c08358e.tar.gz rails-50d262f52ab39680b031e485b89b64875c08358e.tar.bz2 rails-50d262f52ab39680b031e485b89b64875c08358e.zip |
Support symbol and string actions in AC#respond_to options
-rw-r--r-- | actionpack/lib/action_controller/metal/mime_responds.rb | 6 | ||||
-rw-r--r-- | actionpack/test/controller/mime_responds_test.rb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index f10287afb4..00bd1706e7 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -42,8 +42,8 @@ module ActionController #:nodoc: def respond_to(*mimes) options = mimes.extract_options! - only_actions = Array(options.delete(:only)) - except_actions = Array(options.delete(:except)) + only_actions = Array(options.delete(:only)).map(&:to_s) + except_actions = Array(options.delete(:except)).map(&:to_s) new = mimes_for_respond_to.dup mimes.each do |mime| @@ -245,7 +245,7 @@ module ActionController #:nodoc: # current action. # def collect_mimes_from_class_level #:nodoc: - action = action_name.to_sym + action = action_name.to_s self.class.mimes_for_respond_to.keys.select do |mime| config = self.class.mimes_for_respond_to[mime] diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb index afdab30eaf..2aa73f1650 100644 --- a/actionpack/test/controller/mime_responds_test.rb +++ b/actionpack/test/controller/mime_responds_test.rb @@ -509,7 +509,7 @@ end class RespondWithController < ActionController::Base respond_to :html, :json respond_to :xml, :except => :using_resource_with_block - respond_to :js, :only => [ :using_resource_with_block, :using_resource, :using_hash_resource ] + respond_to :js, :only => [ :using_resource_with_block, :using_resource, 'using_hash_resource' ] def using_resource respond_with(resource) |