Ruby on Rails Thursday, April 2, 2015

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.



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4417d4ff-e865-4a55-843b-8f2dfbc8dc78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment