diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-11-29 23:20:31 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-11-29 23:20:31 -0500 |
commit | ece62b9eb3e2f3995715c32608f1de91d98a22be (patch) | |
tree | 2322ac861fe821362a893870d5b2c441132f2204 /rails/app/controllers | |
parent | 83437f5895fd4f110694e66c9d939ff492bc2e1b (diff) | |
download | lingo-ece62b9eb3e2f3995715c32608f1de91d98a22be.tar.gz lingo-ece62b9eb3e2f3995715c32608f1de91d98a22be.tar.bz2 lingo-ece62b9eb3e2f3995715c32608f1de91d98a22be.zip |
Rails engine no longer needed
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 | ||