Questions tagged [impressionist]

Rails gem that tracks impressions and page views.

27 questions
9
votes
1 answer

Rails Impressionist Gem - WillPaginate::Collection is not impressionable

There is any way to use impressionist gem with will paginate? I try to use impressionist to a will_paginate collection like this: posts = Post.all.paginate(:page => params[:page]) impressionist(posts) But It raises this error:…
Mr McDonald
  • 453
  • 7
  • 16
4
votes
1 answer

Rails 7 - uninitialized constant Impressionist::Engine::ImpressionistController (NameError)

After upgrading to rails 7 I'm getting below error with the impressionist gem. When I start my local server. Any help, please? uninitialized constant Impressionist::Engine::ImpressionistController (NameError) ruby "~> 3.0.1" gem "rails", "~>…
Charlie
  • 236
  • 2
  • 13
4
votes
3 answers

Rails 4 - Impressionist Inside of a Resque Background Job

I am using Rails 4 w/ the impressionist and resque gem. I am using impressionist to log unique session hits on my article show page. Due to performance issues and no need to display hits to users (it is for admins only), I would like to move…
Kathan
  • 1,428
  • 2
  • 15
  • 31
3
votes
1 answer

undefined method `cookie_value' for .... Impressionist gem

I've set up the impressionist gem in my Film model. It has been working fine, updating the impressions count, but suddenly I've been receiving the following error when trying to GET the Films#Show page. undefined method `cookie_value' for…
2
votes
0 answers

How can I fix this impressionist gem error?

I have a rails API that I use to create and serve up Posts to mobile clients. I am trying to use the Impressionist gem to track unique views of the Posts based on user_id. It seems simple enough to use, but I keep getting this error: NoMethodError…
Grambo
  • 887
  • 8
  • 25
2
votes
2 answers

wrong number of arguments with impressionist and friendly_id

I'm getting a wrong number of arguments (given 2, expected 0..1) error when trying to track the model her views. My Model: class Codetip < ApplicationRecord belongs_to :user is_impressionable validates :title, presence: true, length: {…
Kevin Etore
  • 1,046
  • 3
  • 14
  • 32
1
vote
1 answer

Gem methods not available inside Grape Api

I'm currently building my first API with Grape and the Rails 5 api mode and it's going fairly well until now. I decided to install the Impressionist gem to be able to log the view counts of a certain model (future "popular" page) but I'm running…
1
vote
1 answer

Define a variable in application controller, but do not use it on pages, where content_for tag won't be present

In my app I will have an ad banner, but it won't be displayed on every page. So, I've defined the ad banner in application controller: before_action :set_ad_banner def set_ad_banner @ad_banner = Advertising …
Alex Zakruzhetskyi
  • 1,383
  • 2
  • 22
  • 43
1
vote
3 answers

rails impressionist how to find 5 of most view item

I using this instance to find more view 5 Item, but cannot get the result. Can teach me how to get it? @test = Item.limit(5).joins(:impressions).group("impressions.impressionable_id").order("count(impressions.impressionable_id) DESC")
werx
  • 17
  • 4
1
vote
1 answer

@project.impressionist_count - wrong number of arguments (given 2, expected 0..1)

I use rails 5 I want to count the number of views of the project I installed gem 'impressionist' Generate the impressions table migration rails g impressionist Run the migration rake db:migrate In view projects/show.html.erb <%=…
Dmitriy
  • 1,157
  • 2
  • 7
  • 7
1
vote
0 answers

Impressionist gem returning zero, why?

Whats wrong with my code? Here's the index <%= post.impressionist_count(:filter=>:ip_address) %> Here's the controller impressionist actions: [:show], unique: [:session_hash] is_impressionable :counter_cache => true, :column_name =>…
Malek Zalfana
  • 318
  • 2
  • 11
0
votes
0 answers

Counting how many times an image appears on screen ERROR

I have a Ruby on Rails 6 project with a bulma theme.There are many photos in my pages. and I want to print the information on how many times people look at these photos. I have also been looking into https://github.com/charlotte-ruby/impressionist…
izgi
  • 11
  • 3
0
votes
0 answers

Remove N+1 queries for impressionist gem

In my Rails app I have the N+1 problem where I'm making extra call(s) to the database to get associated data over and over again, specially when logging impressions per model. For example: Started GET "/" for 127.0.0.1 at 2018-12-02 16:21:05…
VegaStudios
  • 378
  • 1
  • 4
  • 22
0
votes
1 answer

How to graph impressions with chartkick and impressionist?

I'm using Impressionist gem to capture impressions for records, and I'm using chartkick to graph the results. What I would like to do, is count the impressions for the current_user's records, and display the count on chartkick. Its a simple issue,…
0
votes
2 answers

Ruby on Rails extending a gem's class and changing its inheriting class

I have a web app built on Ruby on Rails. In this app obviously use different Gems. Iv come to a point where i want to extend some specific gem's classes, and add methods to it. Now i have a use case where i want to extend a gem's class, but instead…
1
2