[英]Rails view help renders wrong partial
I am having that problem that I am getting the wrong partial rendered. 我遇到的问题是我得到了错误的局部渲染。
Instead of rendering the partial that is located in kategoris/_konkurrencer
而不是渲染位于
kategoris/_konkurrencer
的局部kategoris/_konkurrencer
It is rendering the partial in public/_konkurrencer
它正在
public/_konkurrencer
呈现部分
My action: 我的动作:
def fast
@titel = 'asdasd'
@konkurrancer = Konkurrancer.where('type', 'nyhedsbrev')
render 'kategoris/show'
end
My rails log: 我的rails日志:
Rendered public/_konkurrencer.html.erb (25.0ms)
Rendered shared/_rating.html.erb (1.0ms)
Rendered shared/_google_analytics.html.erb (1.0ms)
Rendered kategoris/show.html.erb within layouts/kategori (103.0ms)
Completed 200 OK in 231ms (Views: 139.0ms | ActiveRecord: 2.0ms)
And my kategoris/show
view file: 和我的
kategoris/show
视图文件:
<%= render 'konkurrencer', :remote => true %>
Add the directory name: 添加目录名称:
<%= render 'kategoris/konkurrencer', :remote => true %>
Ps. 附言 You probably have a good reason to have a partial in the public folder?
您可能有充分的理由在公用文件夹中包含部分内容?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.