Fix bug with missing prefixes when using custom responder
This commit is contained in:
parent
b5a396a594
commit
24ce3a1d7c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user