Avoid double render in posts index
This commit is contained in:
@@ -6,8 +6,7 @@ module Main
|
|||||||
def handle(req, res)
|
def handle(req, res)
|
||||||
res.body = cache(key: "posts_index",
|
res.body = cache(key: "posts_index",
|
||||||
params: [req.params[:q]],
|
params: [req.params[:q]],
|
||||||
content_proc: ->(q) { res.render index, query: q })
|
content_proc: ->(q) { index.call(context: Main::Views::Context.new(request: req), query: q) })
|
||||||
res.status = 200
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user