3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/spree/core/respond_with.rb', line 3
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?
if response = retrieve_response_from_mimes(&block)
options = resources.size == 1 ? {} : resources.
options.merge!(:default_response => response)
options.merge!(:action_name => action_name.to_sym)
(options.delete(:responder) || Spree::Responder).call(self, resources, options)
end
end
|