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.
我只是想知道是否可以在外部类中使用 url 助手?在不加载整个 rails 堆栈的情况下,我只想获取帮助程序而不是整个路由引擎。
我曾考虑在我的外部应用程序中包含 Rails 堆栈,但是由于性能原因我不想这样做。
任何建议将不胜感激。
干杯亚当
我认为如果您包括以下内容就足够了:
include Rails.application.routes.url_helper