On 2 April 2015 at 16:50, Rails_beginner <thebatu@gmail.com> wrote:
> 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 ?
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.
Colin
> 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.
--
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/CAL%3D0gLskAL6apNDxC7jOErEG3S6%2Bo8H5_uvWixt36DRY%3DUJoaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment