Helpers
Helpers modules contain methods that can be used in controllers and views.
CLI tasks
Example
module ProductHelper
def quantity(product)
String.build do |s|
s << product.quantity.to_s
s << " "
s << product.pluralize(product.quantity, product.name)
s << " remaining."
end
end
def name(product)
product.name.titleize
end
endApplication helper
Last updated