hi,
I am trying to make use of a method located in my model (see below)
directly at my view but I am getting undefined method. how can solve
this ?
app/model/operation.rb
def all_products_have_same_posters_count?
- products.all? { |p| p.posters.count == products.first.posters.count
}* - end*
_show.html.haml
-if @operations.all_products_have_same_posters_count?
-
="foobar"*
any recommendations ?
thanks.