From 65f29ae3b55ef82206ebd26e6450b269545c7654 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Sun, 6 Oct 2024 13:05:21 -0400 Subject: [PATCH] Fix deleting tags (just need this for local data) --- app/controllers/tags_controller.rb | 3 ++- app/views/tags/index.html.erb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 70f93287d..c440a9f1b 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -2,6 +2,7 @@ class TagsController < ApplicationController include BucketScoped before_action :set_bubble, only: %i[ new create ] + skip_before_action :set_bucket, only: :destroy def index @tags = Current.account.tags.order(:title) @@ -17,7 +18,7 @@ class TagsController < ApplicationController def destroy Current.account.tags.find(params[:id]).destroy - redirect_to bucket_tags_url(@bucket) + redirect_to root_path end private diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index d9a41c5ad..523c269cf 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -11,7 +11,7 @@ <%= tag.bubbles.map(&:title).to_sentence %> - <%= button_to tag, class: "btn txt-small", method: :delete, data: { turbo_confirm: "Are you sure?" } do %> + <%= button_to tag_path(tag), class: "btn txt-small", method: :delete, data: { turbo_confirm: "Are you sure?" } do %> <%= image_tag "remove.svg", aria: { hidden: true }, size: 24 %> Delete <% end %>