class PublishedPostController < ApplicationController layout 'post' def show @post = Post.find params[:id] @post.try(:increment!, :viewed_times) end end