I am trying to evaluate which indicator needs to be displayed next to an item based on if it’s been viewed before or not, new comments etc. Until I decide on a symbol to use, I just want a number to display.
in my Report Model i have
def self.indicator
#bunch of if elsif statements returning a number 0-3
end
in my view i have
<% @reports.each do |report| %>
<%= report.indicator %>
<% end %>
I get undefined method 'indicator'
I thought I had a grip on how methods work… but clearly not, what am I doing wrong?
Try
You don’t need the self as it [corrected to] is a class level method.