I am using impressionist gem to count each page impression from people who seen article page but the problem is that i get it only work for one article and the counter for the other are for 0
this is my code
class Article < ActiveRecord::Base
is_impressionable
end
class ArticlesController < ApplicationController
impressionist actions: [:show], unique: [:session_hash]
end
This is my show action
<%= "#{@article.impressionist_count} views" %>
Add this code in your controller ..
def show
@article = Article.find
impressionist(@article)
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With