adds random order to debates' index

This commit is contained in:
Juanjo Bazán
2015-09-03 18:50:19 +02:00
parent dbfa35c444
commit 559b60e63f
5 changed files with 24 additions and 2 deletions

View File

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