I have a Rails app with impressionist and friendly id, I want to show page views in my articles. The problem is that impressionist is not registering the number of views.
这个问题也存在: 。
我的文章模式:
class Article < ActiveRecord::Base
is_impressionable
extend FriendlyId
friendly_id :title, use: [:slugged, :history]
belongs_to :user
belongs_to :category
文章管制员:
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
我还重新启用了服务器,但也有同样的问题。