diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-12-07 21:14:52 +0000 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-12-07 21:14:52 +0000 |
commit | 295dd1906a98913275145c5b9cc403f1e76cfd33 (patch) | |
tree | f45d7721c9a138b743ada905a12596f050a7473d /rails/app/controllers | |
parent | 460edd4191229635e86c0e3781a361126c140ca9 (diff) | |
parent | a37605e3d7d17e322a9cf2a497768f6fd8b5d0a3 (diff) | |
download | lingo-295dd1906a98913275145c5b9cc403f1e76cfd33.tar.gz lingo-295dd1906a98913275145c5b9cc403f1e76cfd33.tar.bz2 lingo-295dd1906a98913275145c5b9cc403f1e76cfd33.zip |
Merge branch 'main' of /srv/git/lingo into main
Diffstat (limited to 'rails/app/controllers')
-rw-r--r-- | rails/app/controllers/concerns/.keep | 0 | ||||
-rw-r--r-- | rails/app/controllers/lingo/application_controller.rb | 5 | ||||
-rw-r--r-- | rails/app/controllers/lingo/scores_controller.rb | 25 |
3 files changed, 0 insertions, 30 deletions
diff --git a/rails/app/controllers/concerns/.keep b/rails/app/controllers/concerns/.keep deleted file mode 100644 index e69de29..0000000 --- a/rails/app/controllers/concerns/.keep +++ /dev/null | |||
diff --git a/rails/app/controllers/lingo/application_controller.rb b/rails/app/controllers/lingo/application_controller.rb deleted file mode 100644 index 08b728f..0000000 --- a/rails/app/controllers/lingo/application_controller.rb +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | module Lingo | ||
2 | class ApplicationController < ActionController::Base | ||
3 | protect_from_forgery with: :exception | ||
4 | end | ||
5 | end | ||
diff --git a/rails/app/controllers/lingo/scores_controller.rb b/rails/app/controllers/lingo/scores_controller.rb deleted file mode 100644 index 59bbd9d..0000000 --- a/rails/app/controllers/lingo/scores_controller.rb +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | module Lingo | ||
2 | class ScoresController < ApplicationController | ||
3 | skip_before_action :verify_authenticity_token, only: [:update] | ||
4 | |||
5 | def index | ||
6 | @scores = Score.order(score: :desc) | ||
7 | end | ||
8 | |||
9 | def update | ||
10 | if params[:secret_code] != Lingo.secret_code then | ||
11 | head :unauthorized | ||
12 | else | ||
13 | score = Score.find_or_create_by(user_id: params[:user_id]) do |score| | ||
14 | score.score = 0 | ||
15 | end | ||
16 | score.username = params[:username] | ||
17 | score.avatar_url = CGI.unescape(params[:avatar_url]) | ||
18 | score.score += 1 | ||
19 | score.save! | ||
20 | |||
21 | head :created | ||
22 | end | ||
23 | end | ||
24 | end | ||
25 | end | ||