From 489583486bd9d31de5bec8751d7e63997c325fd3 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 30 Oct 2023 00:18:04 -0400 Subject: added archive page and some expert puzzles --- app/controllers/wittle/puzzles_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/controllers') 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 def about @normal_puzzle = Puzzle.normal.order(created_at: :desc).first @hard_puzzle = Puzzle.hard.order(created_at: :desc).first + @expert_puzzle = Puzzle.expert.order(created_at: :desc).first end def index - #@puzzle = WittleGenerator.new.generate_medium + @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 } end def show -- cgit 1.4.1