diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-12-01 14:53:39 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-12-01 14:53:39 -0600 |
commit | 44587b7faeb2bf2962e9a2e824c341ff1e3f9add (patch) | |
tree | 9a97a90bffca68ab8e0f13003e4590ca9f1a93a2 /actionpack/lib | |
parent | 61a31f3d3dae55b3ed2a49fafcbfe45b77ea3be2 (diff) | |
parent | 0c4990b5f4b8c99ea656170eff9bb9c3490de642 (diff) | |
download | rails-44587b7faeb2bf2962e9a2e824c341ff1e3f9add.tar.gz rails-44587b7faeb2bf2962e9a2e824c341ff1e3f9add.tar.bz2 rails-44587b7faeb2bf2962e9a2e824c341ff1e3f9add.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/metal/responder.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/metal/responder.rb b/actionpack/lib/action_controller/metal/responder.rb index e8e88e7479..6c76c57839 100644 --- a/actionpack/lib/action_controller/metal/responder.rb +++ b/actionpack/lib/action_controller/metal/responder.rb @@ -102,9 +102,14 @@ module ActionController #:nodoc: # not defined, call to_format. # def self.call(*args) - responder = new(*args) - method = :"to_#{responder.format}" - responder.respond_to?(method) ? responder.send(method) : responder.to_format + new(*args).respond + end + + # Main entry point for responder responsible to dispatch to the proper format. + # + def respond + method = :"to_#{format}" + respond_to?(method) ? send(method) : to_format end # HTML format does not render the resource, it always attempt to render a |