#53 Handling Exceptions

When an exception is raised in development you get the full error along with the stack trace. In production, only a simple message is displayed. Learn why this is and how to customize the handling of exceptions.
# application.rb
def local_request?
  false
end

def rescue_action_in_public(exception)
  case exception
  when ActiveRecord::RecordNotFound
    render :file => "#{RAILS_ROOT}/public/404.html", :status => 404
  else
    super
  end
end

你可能感兴趣的:(html,Rails,ActiveRecord)