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)
|
def api_behavior(error)
|
||||||
if post?
|
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)
|
controller.send(:responder_default_template)
|
||||||
else
|
else
|
||||||
RablRails.responder_default_template
|
RablRails.responder_default_template
|
||||||
end
|
end
|
||||||
options[:template] ||= "#{@controller.controller_name}/#{template}"
|
options[:prefixes] = controller._prefixes
|
||||||
|
options[:template] ||= template
|
||||||
|
|
||||||
controller.default_render options.merge(status: :created, location: api_location)
|
controller.default_render options.merge(status: :created, location: api_location)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user