class method
self.root
Ruby on Rails 8.1.2
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 64
def root
application && application.config.root
end
Defined in railties/lib/rails.rb line 64
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails