Method: Rails.root

Defined in:
railties/lib/rails.rb

.rootObject

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>


65
66
67
# File 'railties/lib/rails.rb', line 65

def root
  application && application.config.root
end