Skip to content

Commit

Permalink
Added last_modified to PostsController#show
Browse files Browse the repository at this point in the history
  • Loading branch information
nakajima committed Feb 8, 2009
1 parent c5e2a84 commit d7c2aa3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/posts_controller.rb
Expand Up @@ -32,7 +32,9 @@ def index
def show
redirect_to root_path and return unless current_post.type.match(/Article|Snippet/)

fresh_when(:etag => current_post)
if fresh_when(:etag => current_post.updated_at.to_s.hash, :last_modified => current_post.updated_at.utc)
return
end

@comment = flash[:comment] || current_post.comments.build
respond_to do |format|
Expand Down

0 comments on commit d7c2aa3

Please sign in to comment.