`ActionView::Template::Error (Association named 'report_type' was not found on Article; perhaps you misspelled it?):
37: <div class="col-md-12 text-center">
38: <div class="reportPage carousel-caption">
39: <p class="para-heading bg-circular color-white">
40: <%unless @reports.present? %>
41: <%= 'Statistical' %>
42: <%else%>
43: <%= 'Syndicate' %>
app/views/reports/index.html.erb:40:in `_app_views_reports_index_html_erb___75771321459162625_96601780'
app/controllers/reports_controller.rb:12:in `index'
我在生产中遇到此错误,在具有相同数据的本地实例上也是我没有收到此错误。尝试了很多事情,没有弄错。
class Article < ActiveRecord::Base
extend FriendlyId
friendly_id :slug_candidates, use: :slugged
mount_uploader :article_image, ArticleImageUploader
belongs_to :author
class ReportType < ActiveRecord::Base
mount_uploader :report_type_image, ReportTypeImageUploader
has_many :reports
has_many :statistical_reports
extend FriendlyId
friendly_id :name, use: :slugged
请提供任何帮助或建议。