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.
我有一个安装在我的 Rails(3.2.8) 路由器中的第 3 方 Sinatra(1.3.3) 应用程序。但我想覆盖页面模板,使其看起来与其他部分一致。如何让 Sinatra 在我的 Railsapp/views目录中查找模板?
app/views
在您的 Sinatra 应用程序中定义以下内容:
set :views, '/path/to/rails/views'
如果它不是您的应用程序,也许您可以使用继承。
class MyApp < ThirdPartyApp configure do set :views, '/path/to/rails/views' # Override end end
路线:
mount MyApp.new, at: '/my_app'