diff options
author | Amaia Castro <amaia@amaiac.net> | 2011-03-31 13:19:19 +0200 |
---|---|---|
committer | Amaia Castro <amaia@amaiac.net> | 2011-03-31 13:19:19 +0200 |
commit | a64abdda2505895fec6f0243db5928316c4df90a (patch) | |
tree | ea1db4818af0549b5285b76e42a7da47a4353c60 /actionpack/lib/action_controller/metal | |
parent | f44d85a030f6e22421b26f0d5a0c869fae3efe5f (diff) | |
download | rails-a64abdda2505895fec6f0243db5928316c4df90a.tar.gz rails-a64abdda2505895fec6f0243db5928316c4df90a.tar.bz2 rails-a64abdda2505895fec6f0243db5928316c4df90a.zip |
Explain in the method doc that you need to call respond_to at the class level in order to use respond_with.
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/mime_responds.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index a2e06fe0a6..998bef6556 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -222,6 +222,9 @@ module ActionController #:nodoc: # is quite simple (it just needs to respond to call), you can even give # a proc to it. # + # In order to use respond_with, first you need to declare the formats your + # controller responds to in the class level with a call to <tt>respond_to</tt>. + # def respond_with(*resources, &block) raise "In order to use respond_with, first you need to declare the formats your " << "controller responds to in the class level" if self.class.mimes_for_respond_to.empty? |