有人能告诉我我哪里出错了吗?
在我的视图文件中,我有以下代码
<div>
<ul>
<% CategoryOutsourceadvert.include(:advert).all do |categoryoutsourceadvert| %>
<li>
<%= check_box_tag('q[category_outsourceadverts_id_eq_any][]', categoryoutsourceadvert.id ) %>
<%= categoryoutsourceadvert.name %> (<%= categoryoutsourceadvert.adverts.uniq.count %>)
</li>
<% end %>
</ul>
</div>模型
Advert belongs_to category_outsourceadvert
CategoryOutsourceadvert has_many adverts在我的终端里,我遇到了一个我不明白的错误:
TypeError - wrong argument type Symbol (expected Module):
app/views/adverts/_index.html.erb:134:in `block in _app_views_adverts__index_html_erb___100043438257983213_70223712632760'能否请你向我解释一下这个错误的含义?
发布于 2018-01-31 17:48:23
你忘了那个‘s’
CategoryOutsourceadvert.includes(:advert).allhttps://stackoverflow.com/questions/38101310
复制相似问题