I have a Rails application with an impressionist and a friendly identifier, I want to show pageviews in my articles. The problem is that the impressionist does not record the number of views.
This is the same issue here on the impressionist tracker .
My article model:
class Article < ActiveRecord::Base
is_impressionable
extend FriendlyId
friendly_id :title, use: [:slugged, :history]
belongs_to :user
belongs_to :category
Article Controller:
def show
@article = Article.find(params[:id])
if request.path != article_path(@article)
redirect_to @article, status: :moved_permanently
end
respond_to do |format|
format.html
format.json { render json: @article }
end
end
I also restarted the server but had the same problem.
source
share