Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在“模块响应程序”下实现一个自定义响应程序,但是,我不确定这样的代码应该放在哪里?
这通常是lib目录的用途。
lib
请务必更新您的config/application.rb文件以包含lib在autoload_paths.
config/application.rb
autoload_paths
我通常把它们放进去app/responders
app/responders