app/assets/javascripts/blog/show.js.erb:
$(document).ready(logView);
function logView() {
var id = $(‘div.blog_post’).data(‘id’);
InternalAnalytics.postEvent(id, ‘view’);
}
app/views/blog/show.html.erb:
<div class='column'>
<%= @blog_post.view_count %>
app/models/atom.rb:
def count_view!
self.inc(:view_count, 1)
self.update_index
end
app\views\home\index_report.html.erb: