diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-30 12:40:08 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-30 12:40:08 -0400 |
commit | 82cf9a4f0819bec96d1cf5050cc4e8dc17568be0 (patch) | |
tree | 7bf12ba31911bf9db863ee74a746a42fadb3d6db /app/controllers | |
parent | 4ef2c94a6da2854c0e39a0dc5da682fca2ed4b4d (diff) | |
download | wittle-82cf9a4f0819bec96d1cf5050cc4e8dc17568be0.tar.gz wittle-82cf9a4f0819bec96d1cf5050cc4e8dc17568be0.tar.bz2 wittle-82cf9a4f0819bec96d1cf5050cc4e8dc17568be0.zip |
main page! and other layout stuff
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 |