def edgarj_rescue_sub(ex, message)
      logger.info(
          "#{ex.class} #{ex.message} bactrace:\n  " +
          ex.backtrace.join("\n  "))
  
      respond_to do |format|
        format.html {
          flash[:error] = message
          redirect_to top_path
        }
        format.js {
          flash.now[:error] = message
          render 'message_popup'
        }
      end
    end
def edgarj_rescue_sub(ex, message)
      logger.info(
          "#{ex.class} #{ex.message} bactrace:\n  " +
          ex.backtrace.join("\n  "))
  
      respond_to do |format|
        format.html {
          flash[:error] = message
          redirect_to top_path
        }
        format.js {
          flash.now[:error] = message
          render 'message_popup'
        }
      end
    end
rescue callback sub method to show message by flush on normal http request
 or by popup-dialog on Ajax request.