Fix bug with missing prefixes when using custom responder

This commit is contained in:
ccocchi 2012-10-09 14:24:27 +02:00
parent b5a396a594
commit 24ce3a1d7c
1 changed files with 3 additions and 2 deletions

View File

@ -28,12 +28,13 @@ module RablRails
def api_behavior(error)
if post?
template = if @controller.respond_to?(:responder_default_template, true)
template = if controller.respond_to?(:responder_default_template, true)
controller.send(:responder_default_template)
else
RablRails.responder_default_template
end
options[:template] ||= "#{@controller.controller_name}/#{template}"
options[:prefixes] = controller._prefixes
options[:template] ||= template
controller.default_render options.merge(status: :created, location: api_location)
else