📌  相关文章
📜  rails 将目录添加到加载路径 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:39.254000             🧑  作者: Mango

代码示例1
# In Rails 5 you don't have to explicitly load folders from within the app directory anymore. All folders placed inside are directly available. You don't have to touch any of the config files. But it seems as if there are some issues with Spring.

# The new workflow therefore is:

# create a new folder and class inside the /app directory
#on the command line run 
spring stop 
# check the autoload-paths with 
bin/rails r 'puts ActiveSupport::Dependencies.autoload_paths' on the command line. The new folder should now be listed.
# on the command line run 
spring start