Rails: find controller for a path no comments
Huh, seems simple to do :p, but I’ve been seeking for a while to find the answer and dig into rails code to find a simple method to retrieve the controller of a given path (could be useful to build a navigation). There it is:
ActionController::Routing::Routes.recognize_path(path)[:controller]



