mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-10 07:55:21 +02:00
Example of what no case statement would look like
This commit is contained in:
parent
7140f892f9
commit
690daceba2
1 changed files with 3 additions and 10 deletions
|
@ -17,16 +17,9 @@
|
||||||
data: { rule__actions_target: "actionValue" } do %>
|
data: { rule__actions_target: "actionValue" } do %>
|
||||||
<span class="font-medium uppercase text-xs" data-rule--actions-target="toSpan">to</span>
|
<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. %>
|
<%# Initial rendering based on rule.action_executors.first from the rule form. %>
|
||||||
<%# This is currently always SetTransactionCategory from transaction_resource.rb. %>
|
<%# This is currently always SetTransactionCategory from transaction_resource.rb, which is a select type. %>
|
||||||
<%# Only the first select option will render here, as subsequent renders are injected by the Stimulus controller, which uses the templates from below. %>
|
<%# Subsequent renders are injected by the Stimulus controller, which uses the templates from below. %>
|
||||||
<% case action_type
|
<%= form.select :value, action.options || [], {} %>
|
||||||
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 %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue