From 199bdcae85d7fe9ea3735af654010df20f34e322 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sat, 16 Mar 2024 20:48:56 +1100 Subject: [PATCH] Avoid double render in posts index --- slices/main/actions/posts/index.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/slices/main/actions/posts/index.rb b/slices/main/actions/posts/index.rb index 4682cf7..ee73ef6 100644 --- a/slices/main/actions/posts/index.rb +++ b/slices/main/actions/posts/index.rb @@ -6,8 +6,7 @@ module Main def handle(req, res) res.body = cache(key: "posts_index", params: [req.params[:q]], - content_proc: ->(q) { res.render index, query: q }) - res.status = 200 + content_proc: ->(q) { index.call(context: Main::Views::Context.new(request: req), query: q) }) end end end