2013-01-14 24 views
0

我试图访问在我的错误控制器中导致路由错误的URL。在错误应用程序中访问RoutingError URL

application.rb中

config.exceptions_app = self.routes 

的routes.rb

match "/404", to: "errors#not_found" 

错误控制器

class ErrorsController < ApplicationController 
    layout "error" 

    def not_found 
    end 

protected 

    def app_exception 
    @app_exception ||= env["action_dispatch.exception"] 
    end 

end 

如何ACC引发路由错误的实际URL?当我使用request.url时,我得到\404

回答

1

尝试request.original_fullpath

相关问题