mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user