Displaying 1 result from an estimated 1 matches for "do_something_after_each_ajax_call".
2009 Jul 14
1
How to add after_filter-style render
Hello
I would like to execute specific action rendering something into page
after each of my ajax calls. In example I would like to update some
div or display an alert.
How I imagine it could work is as follows
class ApplicationController < ActionController::Base
after_filter :do_something_after_each_ajax_call
def do_something_after_each_ajax_call
if request.xml_http_request?
render :update do |page|
page << "alert(''doing something!'');
end
end
end
end
Of course code above will yield with "Can only render or redirect once
per action"...