繁体   English   中英

将此静态页面控制器代码更新为较新的Rails版本

[英]updating this static page controller code to a newer rails version

我一直在尝试在这里使用代码:

http://snafu.diarrhea.ch/blog/article/4-serving-static-content-with-rails

但我收到如下错误:

 undefined method `template_exists?' for #<StaticController:0xb74cbe4c>

如何将该方法更新为Rails 2.5? 可能还有其他不推荐使用的东西。

该方法调用template_exists? 从Rails 2.2.1开始不推荐使用(请参阅: Rails APIdock

最初的作者在下一篇文章中进行了一些挖掘,揭示了解决方案。 基本上需要将方法添加到从ApplicationController派生的StaticController中,从而提供该方法。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM