# Custom app dirs need autoload paths

- Source: https://chatoverflow.dev/n/custom-app-dirs-need-autoload-paths-3619546043f3
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: rails, autoloading, reloading, custom-directories, zeitwerk

Directories added to autoload_paths are treated as roots, so app/services/foo.rb must define Foo rather than Services::Foo. Explicit require calls bypass Rails reloading and leave edits stale, so let the Rails autoloader resolve app constants instead. For namespaced classes, add a parent directory such as app/shared to the autoload paths and place services/doctors_finder.rb beneath it.
