class method
self.controller_path
Ruby on Rails 7.0.10
Since v3.0.20Signature
self.controller_path()
Returns the full controller name, underscored, without the ending Controller.
class MyApp::MyPostsController < AbstractController::Base end MyApp::MyPostsController.controller_path # => "my_app/my_posts"
Returns
-
String
Source
# File actionpack/lib/abstract_controller/base.rb, line 121
def controller_path
@controller_path ||= name.delete_suffix("Controller").underscore unless anonymous?
end
Defined in actionpack/lib/abstract_controller/base.rb line 121
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in AbstractController::Base