Undefined method


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 ?


def all_products_have_same_posters_count?

  • products.all? { |p| p.posters.count == products.first.posters.count
  • end*

-if @operations.all_products_have_same_posters_count?

  •  ="foobar"*

any recommendations ?

On 2 April 2015 at 16:50, Rails_beginner [email protected] wrote:

-if @operations.all_products_have_same_posters_count?

any recommendations ?

Is @operations possibly an array of operations rather than an operation?
If you think it is just one post the line of code that sets it up.

Otherwise please post the complete error message here.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs