diff options
author | sadbeast <sadbeast@sadbeast.com> | 2024-01-31 17:47:56 -0800 |
---|---|---|
committer | sadbeast <sadbeast@sadbeast.com> | 2024-01-31 17:47:56 -0800 |
commit | 332ec93366315fa1ed7b4acd7a3407c96e8ddfa7 (patch) | |
tree | 6ae553317f12a7a6a29c849c8805ffab96436dc2 /app/controllers | |
download | td-main.tar.gz td-main.tar.bz2 |
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/concerns/.keep | 0 | ||||
-rw-r--r-- | app/controllers/leagues_controller.rb | 16 | ||||
-rw-r--r-- | app/controllers/rodauth_controller.rb | 4 |
4 files changed, 22 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..09705d1 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/controllers/concerns/.keep diff --git a/app/controllers/leagues_controller.rb b/app/controllers/leagues_controller.rb new file mode 100644 index 0000000..102a9bd --- /dev/null +++ b/app/controllers/leagues_controller.rb @@ -0,0 +1,16 @@ +class LeaguesController < ApplicationController + def index + @leagues = League.all + end + + def show + league_id = params[:id] + @league = League.find_by(league_id: league_id) + + @q = LeaguePickScore.where(league_id: league_id).ransack(params[:q]) + @q.sorts = 'total desc' if @q.sorts.empty? + @scores = @q.result(distinct: true) + + @player_scores = PlayerScore.where(league_id: league_id) + end +end diff --git a/app/controllers/rodauth_controller.rb b/app/controllers/rodauth_controller.rb new file mode 100644 index 0000000..469db79 --- /dev/null +++ b/app/controllers/rodauth_controller.rb @@ -0,0 +1,4 @@ +class RodauthController < ApplicationController + # used by Rodauth for rendering views, CSRF protection, and running any + # registered action callbacks and rescue_from handlers +end |