Explain in the method doc that you need to call respond_to at the class level in order to use respond_with.

This commit is contained in:
Amaia Castro
2011-03-31 13:19:19 +02:00
parent f44d85a030
commit a64abdda25

View File

@@ -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?