lib/rails_ext/hacks/ajax_flash.rb in rails-ext-0.3.2 vs lib/rails_ext/hacks/ajax_flash.rb in rails-ext-0.3.3
- old
+ new
@@ -1,9 +1,9 @@
#
# ordinary and ajax flash[:info] (othervise it appears twice with ajax requests)
#
ActionController::Base.class_eval do
def flash_with_ajax
- request.xhr? ? flash_without_ajax.now : flash_without_ajax
+ (request.xhr? or request.format == 'js') ? flash_without_ajax.now : flash_without_ajax
end
alias_method_chain :flash, :ajax
end
\ No newline at end of file