Class: PostsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/posts_controller.rb

Instance Method Summary collapse

Instance Method Details

#feedObject



8
9
10
11
12
13
14
# File 'app/controllers/posts_controller.rb', line 8

def feed
  max_age = 4.hours
  response.headers['Cache-Control'] = 'public, max-age=' + max_age.to_i.to_s
  response.headers['Expires'] = max_age.from_now.httpdate
  response.content_type = 'application/atom+xml'
  fresh_when :last_modified => Post.feed_last_modified
end

#showObject



4
5
6
# File 'app/controllers/posts_controller.rb', line 4

def show
  resource
end