Sha256: 45047c5f5dc0d6435e9313a76253c0f3154a53c17cb6abfe45214c4a6d439a13
Contents?: true
Size: 894 Bytes
Versions: 42
Compression:
Stored size: 894 Bytes
Contents
# rescue part for EdgarjController (or ApplicationController) and # EdgarjPopupController # module Edgarj module RescueMixin private # rescue callback sub method to show message by flush on normal http request # or by popup-dialog on Ajax request. 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 for 404 def edgarj_rescue_404(ex) edgarj_rescue_sub(ex, v('not_found')) end # rescue callback def edgarj_rescue_app_error(ex) edgarj_rescue_sub(ex, ex.message) end end end
Version data entries
42 entries across 42 versions & 1 rubygems