Displaying 1 result from an estimated 1 matches for "overriderescue_action_in_public".
2011 Mar 16
1
Help overriding rescue_action_in_public in Rails 3
..._file like so:
# ApplicationController.rb
protected
def render_optional_error_file(status_code)
render :template => "errors/500", :status => 500, :layout => ''application''
end
However, Rails 3 no longer has render_optional_error_file. Instead, you need to overriderescue_action_in_public, which I do:
# config/initializers/error_page.rb
module ActionDispatch
class ShowExceptions
protected
def rescue_action_in_public(exception)
status = status_code(exception).to_s
template = ActionView::Base.new(["#{Rails.root}/app/views"])
if [&qu...