Use locals in responder. Responder now works out of the box with
Devise
This commit is contained in:
parent
4b61edad64
commit
395a3d7439
@ -6,14 +6,14 @@ module RablRails
|
|||||||
#
|
#
|
||||||
class Responder < ActionController::Responder
|
class Responder < ActionController::Responder
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def api_behavior(error)
|
def api_behavior(error)
|
||||||
rabl_options = options.merge(template: RablRails.responder_default_template)
|
rabl_options = options.merge(template: RablRails.responder_default_template)
|
||||||
|
|
||||||
if get?
|
if get?
|
||||||
controller.default_render rabl_options
|
controller.default_render rabl_options
|
||||||
elsif post?
|
elsif post?
|
||||||
controller.default_render rabl_options.merge!(status: :created, location: api_location)
|
controller.default_render rabl_options.merge!(status: :created, location: api_location, locals: { resource: resource })
|
||||||
else
|
else
|
||||||
head :no_content
|
head :no_content
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user