1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 07:25:19 +02:00

Example of what no case statement would look like

This commit is contained in:
hatz 2025-05-02 16:11:57 -05:00
parent 7140f892f9
commit 690daceba2
No known key found for this signature in database

View file

@ -17,16 +17,9 @@
data: { rule__actions_target: "actionValue" } do %>
<span class="font-medium uppercase text-xs" data-rule--actions-target="toSpan">to</span>
<%# 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 %>
</div>