Rules

<% if @rules.any? %> <%= render MenuComponent.new do |menu| %> <% menu.with_item( variant: "button", text: "Delete all rules", href: destroy_all_rules_path, icon: "trash-2", method: :delete, confirm: CustomConfirm.for_resource_deletion("all rules", high_severity: true)) %> <% end %> <% end %> <%= render LinkComponent.new( text: "New rule", variant: "primary", href: new_rule_path(resource_type: "transaction"), icon: "plus", frame: :modal ) %>
<% if self_hosted? %>
<%= icon("circle-alert", size: "sm") %>

AI-enabled rule actions will cost money. Be sure to filter as narrowly as possible to avoid unnecessary costs.

<% end %>
<% if @rules.any? %>

Rules

·

<%= @rules.count %>

Sort by: <%= form_with url: rules_path, method: :get, local: true, class: "flex items-center", data: { controller: "auto-submit-form" } do |form| %> <%= form.select :sort_by, options_for_select([["Name", "name"], ["Updated At", "updated_at"]], @sort_by), {}, class: "min-w-[120px] bg-transparent rounded border-none cursor-pointer text-primary uppercase text-xs w-auto", data: { auto_submit_form_target: "auto", autosubmit_trigger_event: "change" } %> <%= form.hidden_field :direction, value: @direction %> <% end %> <%= render LinkComponent.new( href: rules_path(direction: @direction == "asc" ? "desc" : "asc", sort_by: @sort_by), variant: "icon", icon: "arrow-up-down", size: :sm, title: "Toggle sort direction" ) %>
<%= render partial: "rule", collection: @rules, spacer_template: "shared/ruler" %>
<% else %>

No rules yet

Set up rules to perform actions to your transactions and other data on every account sync.

<%= render LinkComponent.new( text: "New rule", variant: "primary", href: new_rule_path(resource_type: "transaction"), icon: "plus", frame: :modal ) %>
<% end %>