ruby-on-rails – ActionView :: MissingTemplate:缺少模板
发布时间:2020-12-17 03:13:56 所属栏目:百科 来源:网络整理
导读:当谷歌机器人试图访问我的一个控制器时,我收到此错误消息. ActionView::MissingTemplate: Missing template channels/show,application/show with {:locale=[:"sv-SE",:en],:formats=["*/*;q=0.9"],:handlers=[:erb,:builder,:haml]}. Searched in: * "/opt/
当谷歌机器人试图访问我的一个控制器时,我收到此错误消息.
ActionView::MissingTemplate: Missing template channels/show,application/show with {:locale=>[:"sv-SE",:en],:formats=>["*/*;q=0.9"],:handlers=>[:erb,:builder,:haml]}. Searched in: * "/opt/www/app/releases/20120228181534/app/views" * "/opt/www/app/shared/bundle/ruby/1.9.1/gems/kaminari-0.13.0/app/views" 问题是我无法重现它. Here是回溯. 第18行是我的应用程序中唯一提到的行,它是此代码的超级部分 def render(options = {},extra_options = {},&block) if request.headers['X-PJAX'] or params[:no_layout] == "true" or params[:_pjax] options[:layout] = false end super(options,extra_options,&block) end 控制器方法渠道#show看起来像这样 def show @channel = # ... @today = # ... @yesterday = # ... @tomorrow = # ... end 访问引发谷歌机器人错误的网址不会给我带来错误. 唯一失败的网址是包含特殊字符的网址,例如{“action”=>“show”,“id”=>“25-j?nk?ping”,“controller”=>“渠道”}. ORIGINAL_FULLPATH值设置为/ channels / 25-j?nk?ping. 我正在使用rails 3.2.1. 解决方法
这最近已在master中修复并后端移植到3.2分支:
有关原始错误报告,请参阅 https://github.com/rails/rails/issues/736;有关猴子补丁的信息,请参阅 https://gist.github.com/1754727;有关已接受的请求,请参阅github.com/rails/rails/pull/4918. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |