1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00
Maybe/app/helpers/transactions_helper.rb

21 lines
675 B
Ruby
Raw Normal View History

module TransactionsHelper
def transaction_filters
[
{ name: "Account", partial: "account_filter", icon: "layers" },
{ name: "Date", partial: "date_filter", icon: "calendar" },
{ name: "Type", partial: "type_filter", icon: "shapes" },
{ name: "Amount", partial: "amount_filter", icon: "hash" },
{ name: "Category", partial: "category_filter", icon: "tag" },
{ name: "Merchant", partial: "merchant_filter", icon: "store" }
]
end
def transaction_filter_id(filter)
"txn-#{filter[:name].downcase}-filter"
end
def transaction_filter_by_name(name)
transaction_filters.find { |filter| filter[:name] == name }
end
end