From 690daceba20b853fc26186048fcaf81f86f5719f Mon Sep 17 00:00:00 2001 From: hatz Date: Fri, 2 May 2025 16:11:57 -0500 Subject: [PATCH] Example of what no case statement would look like --- app/views/rule/actions/_action.html.erb | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/views/rule/actions/_action.html.erb b/app/views/rule/actions/_action.html.erb index 414d239e..ad71038a 100644 --- a/app/views/rule/actions/_action.html.erb +++ b/app/views/rule/actions/_action.html.erb @@ -17,16 +17,9 @@ data: { rule__actions_target: "actionValue" } do %> to <%# Initial rendering based on rule.action_executors.first from the rule form. %> - <%# This is currently always SetTransactionCategory from transaction_resource.rb. %> - <%# Only the first select option will render here, as subsequent renders are injected by the Stimulus controller, which uses the templates from below. %> - <% case action_type - when "select" %> - <%= form.select :value, action.options || [], {} %> - <% when "text" %> - <%= form.text_field :value, placeholder: "Enter a value" %> - <% when "function" %> - <%# Function type doesn't need a value input %> - <% end %> + <%# This is currently always SetTransactionCategory from transaction_resource.rb, which is a select type. %> + <%# Subsequent renders are injected by the Stimulus controller, which uses the templates from below. %> + <%= form.select :value, action.options || [], {} %> <% end %>