diff options
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 3c3c8a6..b481460 100644 --- a/app/controllers/wittle/puzzles_controller.rb +++ b/app/controllers/wittle/puzzles_controller.rb | |||
| @@ -2,8 +2,16 @@ module Wittle | |||
| 2 | class PuzzlesController < ApplicationController | 2 | class PuzzlesController < ApplicationController |
| 3 | def about | 3 | def about |
| 4 | @normal_puzzle = Puzzle.normal.order(created_at: :desc).first | 4 | @normal_puzzle = Puzzle.normal.order(created_at: :desc).first |
| 5 | @normal_started = ((session[:started_puzzles] || []).include? @normal_puzzle.id) | ||
| 6 | @normal_solved = ((session[:played_puzzles] || []).include? @normal_puzzle.id) | ||
| 7 | |||
| 5 | @hard_puzzle = Puzzle.hard.order(created_at: :desc).first | 8 | @hard_puzzle = Puzzle.hard.order(created_at: :desc).first |
| 9 | @hard_started = ((session[:started_puzzles] || []).include? @hard_puzzle.id) | ||
| 10 | @hard_solved = ((session[:played_puzzles] || []).include? @hard_puzzle.id) | ||
| 11 | |||
| 6 | @expert_puzzle = Puzzle.expert.order(created_at: :desc).first | 12 | @expert_puzzle = Puzzle.expert.order(created_at: :desc).first |
| 13 | @expert_started = ((session[:started_puzzles] || []).include? @expert_puzzle.id) | ||
| 14 | @expert_solved = ((session[:played_puzzles] || []).include? @expert_puzzle.id) | ||
| 7 | end | 15 | end |
| 8 | 16 | ||
| 9 | def index | 17 | def index |
