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