From d0c33b85506ea3af4b69f32df6cc4ee607921128 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Thu, 30 Oct 2025 14:52:30 +0100 Subject: [PATCH] Add http caching for the new columns/edit card resource --- app/controllers/cards/columns_controller.rb | 3 +++ app/views/cards/columns/edit.html.erb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/cards/columns_controller.rb b/app/controllers/cards/columns_controller.rb index 922955078..e41225050 100644 --- a/app/controllers/cards/columns_controller.rb +++ b/app/controllers/cards/columns_controller.rb @@ -1,5 +1,8 @@ class Cards::ColumnsController < ApplicationController def edit @card = Current.user.accessible_cards.find(params[:card_id]) + @columns = @card.collection.columns + + fresh_when etag: [ @card, @columns ] end end diff --git a/app/views/cards/columns/edit.html.erb b/app/views/cards/columns/edit.html.erb index 9c71884a7..ae38fed17 100644 --- a/app/views/cards/columns/edit.html.erb +++ b/app/views/cards/columns/edit.html.erb @@ -14,7 +14,7 @@ aria: { checked: @card.awaiting_triage? }, form_class: "flex align-center gap-half" %> - <% @card.collection.columns.each do |column| %> + <% @columns.each do |column| %> <%= button_to_set_column @card, column %> <% end %>