recommendable icon indicating copy to clipboard operation
recommendable copied to clipboard

Unable to use in controller

Open alexanderisora opened this issue 7 years ago • 1 comments

Hello David! Thanks for your gem.

I'm trying to reach the total likes count in my controller's method: @length = Site.first.liked_by_count

Alas, I get error: undefined method liked_by_count' for #Post:0x007fde4d4b2f98` Invoking the method from views is possible.

How to use 'liked_by_count' from controllers? Thanks.

alexanderisora avatar Jul 16 '17 17:07 alexanderisora

Hey @alexanderisora, without looking at some code, that's gonna be a tough one to debug. Do you think you'd be able to reproduce this in a new Rails app that I could clone locally to take a look at?

davidcelis avatar Jul 18 '17 18:07 davidcelis