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 没问题(例如,模型颜色的 new_color_path)但是如果我试图创建一个可用于多个模型的部分,我仍然需要“new_***_path”或一个其他人的?是否可以从模型对象生成 url?
你可能会从polymorphic_url得到你需要的东西。