Sha256: e0e4dae319800bb9896fb97c68415fd88c3a28da0c8580a33a20aba8ee884bdb
Contents?: true
Size: 573 Bytes
Versions: 28
Compression:
Stored size: 573 Bytes
Contents
ActionController::Base.send :class_eval do protected def redirect_to_with_ajax *args if request.xhr? or request.format == 'js' preserve_flash_for_ajax_page_update render :inline => "window.location = '#{url_for *args}';", :layout => 'application' else redirect_to_without_ajax *args end end alias_method_chain :redirect_to, :ajax private def preserve_flash_for_ajax_page_update # save flash.now (that are marked as used) with ajax redirect used = flash_without_ajax.instance_variable_get '@used' used.clear end end
Version data entries
28 entries across 28 versions & 2 rubygems