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