Is it possible to run a controller method after rendering a JSON response?

Go To StackoverFlow.com

1

I have a controller method that is a little something like this:

def suggestions
  # Stuff
  render :json => {"success" => true'}
end

Is it possible to run a method after the render response? I'd like to not hold up the frontend if possible.

Thanks

2012-04-05 19:10
by AnApprentice
Yes, did you try it - Michael Berkowski 2012-04-05 19:16


2

Yes, the method will continue to execute until it reaches the end. The only issue you really need to watch out for is accidentally calling render again. You may only call render once.

2012-04-05 19:24
by Ben Miller
Ads