ensl.org/app/controllers/rounds_controller.rb

27 lines
606 B
Ruby
Raw Normal View History

class RoundsController < ApplicationController
def index
sort = case params['sort']
when "start" then "start"
when "server" then "server_id"
when "team1" then "team1_id"
when "team2" then "team2_id"
when "map" then "map_name"
when "commander" then "commander_id"
end
@rounds = Round.basic.paginate \
2014-03-31 21:33:16 +00:00
order: sort,
page: params[:page],
per_page: 30
if params[:ajax]
2014-03-31 21:33:16 +00:00
render partial: 'list', layout: false
return
end
end
def show
@round = Round.find(params[:id])
end
end