Impressionist

#2 Impressionist
7/19/2015

Summary

A lightweight plugin that logs impressions per action or manually per model
1
view analytics rails

Summary

Gemfile     gem 'impressionist'
bash    bundle install
    rails g impressionist
    rake db:migrate
blogs_controller.rb    BlogsController < ApplicationController
      impressionist :actions=>[:show,:index]
    end

    def show
      @blog = Blog.find
      impressionist(@blog, "message...") # 2nd argument is optional
    end    
blog.rb    class Blog < ActiveRecord::Base
      is_impressionable
    end
index.html.erb    @blog.impressionist_count