Added Rails helpers

Necessary to extract from the `Filters` module since the current implementation uses a nested class. There's a couple of reasons why this is important:

* Use of a class is unnecessary and wasteful since there is no state. This is also known as the link:https://alchemists.io/articles/ruby_antipatterns#_nonclasses[Nonclass] antipattern.
* Due to the class having no state, the functionalitity can be fully encapsulated within a module as purely functional methods.
* Modules are the most lightweight and performant objects in Ruby.

We'll soon be able to replace the nested `Filters` class with this implementation.

Milestone: minor
This commit is contained in:
Brooke Kuhlmann
2026-02-02 08:30:16 -07:00
parent 23c59d1953
commit 7778352d99
+12
View File
@@ -0,0 +1,12 @@
# frozen_string_literal: true
require "action_view"
module TRMNL
module Liquid
module RailsHelpers
extend ActionView::Helpers::TextHelper
extend ActionView::Helpers::NumberHelper
end
end
end