首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

rails 3.0 错误处理

2012-12-21 
rails 3.0异常处理in your application.rbActionController::Baserescue_from ActionController::RoutingE

rails 3.0 异常处理
in your application.rb

ActionController::Base  rescue_from ActionController::RoutingError, :with => :render_404  private  def render_404(exception = nil)    if exception        logger.info "Rendering 404: #{exception.message}"    end    render :file => "#{Rails.root}/public/404.html", :status => 404, :layout => false  end

热点排行