Just a quick tip.
If you’re using Rails 3.2 and the file change based code reloading feature but don’t add
autoload_paths, then changes to files in
lib are not noticed when you refresh your browser.
Many people probably just add
autoload_paths, but this is not the way the Rails core team intends for
lib to be used. The
lib directory is where the vast majority of your app should live, all your domain logic should go there. As with other external dependencies (and Rails is an external dependency of your app), you need to require code manually.
The recommended approach is to leave
lib out of
autoload_paths and require files as needed using
The magic source to your files in
lib reloaded when changed, is:
config.watchable_dirs['lib'] = [:rb]
config.watchable_files if you just want to watch individual files.