Permalink
Browse files

Explain in the method doc that you need to call respond_to at the cla…

…ss level in order to use respond_with.
  • Loading branch information...
1 parent f44d85a commit a64abdda2505895fec6f0243db5928316c4df90a @amaia amaia committed Mar 31, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 actionpack/lib/action_controller/metal/mime_responds.rb
@@ -222,6 +222,9 @@ def respond_to(*mimes, &block)
# 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?

0 comments on commit a64abdd

Please sign in to comment.