about summary refs log tree commit diff stats
path: root/app/controllers
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-10-30 00:18:04 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-10-30 00:18:04 -0400
commit489583486bd9d31de5bec8751d7e63997c325fd3 (patch)
treef6ebe78ad4acbfb39e76bc80aeea0ca9f17b5a1b /app/controllers
parent392cc8a0f938b0f363e1a9227d5ff9a3ecbdbe10 (diff)
downloadwittle-489583486bd9d31de5bec8751d7e63997c325fd3.tar.gz
wittle-489583486bd9d31de5bec8751d7e63997c325fd3.tar.bz2
wittle-489583486bd9d31de5bec8751d7e63997c325fd3.zip
added archive page and some expert puzzles
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/wittle/puzzles_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/wittle/puzzles_controller.rb b/app/controllers/wittle/puzzles_controller.rb index 2949f94..3c3c8a6 100644 --- a/app/controllers/wittle/puzzles_controller.rb +++ b/app/controllers/wittle/puzzles_controller.rb
@@ -3,10 +3,11 @@ module Wittle
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 @hard_puzzle = Puzzle.hard.order(created_at: :desc).first 5 @hard_puzzle = Puzzle.hard.order(created_at: :desc).first
6 @expert_puzzle = Puzzle.expert.order(created_at: :desc).first
6 end 7 end
7 8
8 def index 9 def index
9 #@puzzle = WittleGenerator.new.generate_medium 10 @puzzles = Puzzle.select(:id, :created_at, :category).order(created_at: :asc).all.chunk { |puzzle| puzzle.created_at.localtime.to_date }.to_h.transform_values { |by_date| by_date.sort_by(&:category).chunk { |puzzle| puzzle.category }.to_h }
10 end 11 end
11 12
12 def show 13 def show