chore: init commit

in worker.../repo/GITFOLDER.zip is the .git folder.
This commit is contained in:
2026-08-11 14:44:09 -04:00
parent 0012380fd3
commit 392781f7aa
781 changed files with 65944 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
# frozen_string_literal: true
module ApplicationHelper
def ticker_stocks
Stock.active.order(:ticker)
end
def format_money(cents)
format("$%.2f", cents / 100.0)
end
def safe_url(url)
uri = URI.parse(url)
%w[http https].include?(uri.scheme) ? url : nil
rescue URI::InvalidURIError
nil
end
# Generates a sort link for table headers
# @param column [Symbol] The column name
# @param label [String] The display label
# @return [String] HTML link
def sort_link(column, label)
direction = params[:sort] == column.to_s && params[:direction] == "asc" ? "desc" : "asc"
icon = sort_icon(column)
# Build URL with query parameters
url = url_for(sort: column, direction: direction, only_path: true)
link_to url, class: "group inline-flex items-center" do
safe_join(
[
label,
content_tag(
:span, icon,
class: "ml-2 flex-none rounded text-gray-900 group-hover:text-gray-900"
)
]
)
end
end
# Returns the sort icon for a column
# @param column [Symbol] The column name
# @return [String] Icon HTML
def sort_icon(column)
if params[:sort] == column.to_s
params[:direction] == "asc" ? "↑" : "↓"
else
"⇅"
end
end
end