Use locals in responder. Responder now works out of the box with

Devise
This commit is contained in:
ccocchi 2012-09-13 16:04:43 +02:00
parent 4b61edad64
commit 395a3d7439
1 changed files with 3 additions and 3 deletions

View File

@ -6,14 +6,14 @@ module RablRails
#
class Responder < ActionController::Responder
protected
def api_behavior(error)
rabl_options = options.merge(template: RablRails.responder_default_template)
if get?
controller.default_render rabl_options
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
head :no_content
end