Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不是想看看当前的控制器是什么。有问题的 URL 代表先前的请求。
例如:输入/foo/6
/foo/6
输出:(显示控制器的哈希FooController,操作show,id 6)
FooController
show
6
看recognize_path
recognize_path
Rails.application.routes.recognize_path('/foo/6')
输出:
{:action=>"show", :controller="foo", :id="6"}