adds 'most commented' order to debates

This commit is contained in:
Juanjo Bazán
2015-09-03 18:31:16 +02:00
parent cd3806476f
commit dbfa35c444
5 changed files with 27 additions and 9 deletions

View File

@@ -82,7 +82,7 @@ class DebatesController < ApplicationController
end
def parse_order
@valid_orders = ['created_at', 'score']
@valid_orders = ['created_at', 'score', 'most_commented']
@order = @valid_orders.include?(params[:order]) ? params[:order] : 'created_at'
end