Class: RatingsController

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

Instance Method Summary collapse

Instance Method Details

#postsObject


2
3
4
5
# File 'app/controllers/ratings_controller.rb', line 2

def posts
  days = params[:days] || 7
  @posts = Post.published.newer_than(days.to_i.days.ago).order('views DESC').limit(20)
end