module RulesEngineView module Alerts def re_alert result = '
'.html_safe unless flash[:error].blank? result << '
Error : '.html_safe result << flash.delete(:error) result << 'Close
'.html_safe flash.delete(:success) flash.delete(:notice) end unless flash[:success].blank? result << '
Success : '.html_safe result << flash.delete(:success) result << 'Close
'.html_safe flash.delete(:notice) end unless flash[:notice].blank? result << '
Warning : '.html_safe result << flash.delete(:notice) result << 'Close
'.html_safe end result << '
'.html_safe return result end def re_alert_js unless flash[:error].blank? flash.delete(:success) flash.delete(:notice) return "$.re_error_message('".html_safe + escape_javascript(flash.delete(:error)) + "');".html_safe end unless flash[:success].blank? flash.delete(:notice) return "$.re_success_message('".html_safe + escape_javascript(flash.delete(:success)) + "');".html_safe end unless flash[:notice].blank? return "$.re_notice_message('".html_safe + escape_javascript(flash.delete(:notice)) + "');".html_safe end end end end