summary refs log tree commit diff stats
path: root/rails/app/controllers
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-12-07 21:14:52 +0000
committerStar Rauchenberger <fefferburbia@gmail.com>2023-12-07 21:14:52 +0000
commit295dd1906a98913275145c5b9cc403f1e76cfd33 (patch)
treef45d7721c9a138b743ada905a12596f050a7473d /rails/app/controllers
parent460edd4191229635e86c0e3781a361126c140ca9 (diff)
parenta37605e3d7d17e322a9cf2a497768f6fd8b5d0a3 (diff)
downloadlingo-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/.keep0
-rw-r--r--rails/app/controllers/lingo/application_controller.rb5
-rw-r--r--rails/app/controllers/lingo/scores_controller.rb25
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 @@
1module Lingo
2 class ApplicationController < ActionController::Base
3 protect_from_forgery with: :exception
4 end
5end
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 @@
1module 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
25end