diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-29 21:04:43 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-29 21:04:43 -0400 |
| commit | 03f44c53e35fc1643a39a1e31141ead8c275a3a0 (patch) | |
| tree | 74e9e1e5086c9739a13500793378012838b8a3dd /app/controllers | |
| parent | 862cb4e3f9b9864bc1b5a20cd7ebd7c4d6cccb77 (diff) | |
| download | wittle-03f44c53e35fc1643a39a1e31141ead8c275a3a0.tar.gz wittle-03f44c53e35fc1643a39a1e31141ead8c275a3a0.tar.bz2 wittle-03f44c53e35fc1643a39a1e31141ead8c275a3a0.zip | |
disable sending a time if you refresh the page
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/wittle/puzzles_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
| diff --git a/app/controllers/wittle/puzzles_controller.rb b/app/controllers/wittle/puzzles_controller.rb index ed7087a..2949f94 100644 --- a/app/controllers/wittle/puzzles_controller.rb +++ b/app/controllers/wittle/puzzles_controller.rb | |||
| @@ -12,6 +12,14 @@ module Wittle | |||
| 12 | def show | 12 | def show |
| 13 | @puzzle = Puzzle.find(params[:id]) | 13 | @puzzle = Puzzle.find(params[:id]) |
| 14 | @playable = @puzzle.latest? && !((session[:played_puzzles] || []).include? @puzzle.id) | 14 | @playable = @puzzle.latest? && !((session[:played_puzzles] || []).include? @puzzle.id) |
| 15 | @already_started = ((session[:started_puzzles] || []).include? @puzzle.id) | ||
| 16 | end | ||
| 17 | |||
| 18 | def start | ||
| 19 | @puzzle = Puzzle.find(params[:id]) | ||
| 20 | |||
| 21 | session[:started_puzzles] ||= [] | ||
| 22 | session[:started_puzzles] << @puzzle.id | ||
| 15 | end | 23 | end |
| 16 | 24 | ||
| 17 | def solve | 25 | def solve |
