0
我想知道为什么我可以在rails 4或rails 5中使用request.path
,即使它没有记录在ActionDispatch :: Request中。为什么我可以在rails4和rails5中使用request.path,它在哪里记录?
logger.info(request)
# returns #<ActionDispatch::Request:0x007f7bf44e22e0>
logger.info(request.path)
# returns /home
没有路径的方法在这里: http://api.rubyonrails.org/classes/ActionDispatch/Request.html
这是方法与机架遗传吗? http://www.rubydoc.info/gems/rack/Rack/Request/Helpers#path-instance_method