异常捕获
- 作者 firedragonpzy
- 31 七月, 2012
- 暂无评论
rescue_from ActiveRecord::RecordNotFound do |exception|
render :text => “没有该记录”
end
rescue_from ActionController::ActionControllerError do |exception|
render :text => “没有控制器”
end
rescue_from ActionView::ActionView do |exception|
render :text => “没有该页面”
end