class method
self.root
Ruby on Rails 8.0.4
Since v2.2.3Signature
self.root()
Returns a Pathname object of the current Rails project, otherwise it returns nil if there is no project:
Rails.root # => #<Pathname:/Users/someuser/some/path/project>
Source
# File railties/lib/rails.rb, line 65
def root
application && application.config.root
end
Defined in railties/lib/rails.rb line 65
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails