Home Rails throwing error: ActionView::Template::Error (Association named 'report_type' was not found on Article; perhaps you misspelled it
Reply: 0

Rails throwing error: ActionView::Template::Error (Association named 'report_type' was not found on Article; perhaps you misspelled it

Sontya
1#
Sontya Published in 2017-11-29 10:57:00Z
    `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'

I am getting this error on production, on local instance with the same data also I am not getting this error. Tried many things, not getting what's wrong.

Article.rb

class Article < ActiveRecord::Base
       extend FriendlyId
       friendly_id :slug_candidates, use: :slugged
       mount_uploader :article_image, ArticleImageUploader
       belongs_to :author

ReportType.rb

class ReportType < ActiveRecord::Base
  mount_uploader :report_type_image, ReportTypeImageUploader
  has_many :reports
  has_many :statistical_reports
  extend FriendlyId
  friendly_id :name, use: :slugged

Any help or suggestions on this, please.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306408 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO