当前位置: 动力学知识库 > 问答 > 编程问答 >

updating this static page controller code to a newer rails version

问题描述:

I've been trying to use the code here:

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

but I'm getting errors like:

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

How can I update this method to Rails 2.5? Probably there are other deprecated things too.

网友答案:

The method call template_exists? is deprecated as of Rails 2.2.1 (see: Rails APIdock)

A little bit of digging revealed the solution, by the original author, in the following article article. Basically requires adding the method into the StaticController, derived from ApplicationController and thus gives the method.

分享给朋友:
您可能感兴趣的文章:
随机阅读: