From 38b6e30bea1e9d28df16d232c44b07fa8df14918 Mon Sep 17 00:00:00 2001 From: Josh Pigford Date: Thu, 1 May 2025 17:01:40 -0500 Subject: [PATCH] Add conditional rendering for sync all button in transactions index view - The "Dev only: Sync all" button is now only displayed in the development environment to prevent accidental usage in production. --- app/views/transactions/index.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/transactions/index.html.erb b/app/views/transactions/index.html.erb index 6ab1cc44..9781672f 100644 --- a/app/views/transactions/index.html.erb +++ b/app/views/transactions/index.html.erb @@ -4,7 +4,9 @@
<%= render MenuComponent.new do |menu| %> - <% menu.with_item(variant: "button", text: "Dev only: Sync all", href: sync_all_accounts_path, method: :post, icon: "refresh-cw") %> + <% if Rails.env.development? %> + <% menu.with_item(variant: "button", text: "Dev only: Sync all", href: sync_all_accounts_path, method: :post, icon: "refresh-cw") %> + <% end %> <% menu.with_item(variant: "link", text: "New rule", href: new_rule_path(resource_type: "transaction"), icon: "plus", data: { turbo_frame: :modal }) %> <% menu.with_item(variant: "link", text: "Edit rules", href: rules_path, icon: "git-branch", data: { turbo_frame: :_top }) %> <% menu.with_item(variant: "link", text: "Edit categories", href: categories_path, icon: "shapes", data: { turbo_frame: :_top }) %>