{{
}}
and are denoted by a pipe character |
.item
is the object, title
is its attribute, and upcase
is the filter being applied.order.line_items
is an array of line items or order.transactions
is an array of transactions.first
with dot notation when you need to use the filter inside a tag.last
with dot notation when you need to use the filter inside a tag.last
on a string returns the last character in the string.concat
will not remove duplicate entries from the concatenated array unless you also use the uniq
filter.concat
filters to combine more than two arrays:[0]
.map_values
is the filter name. The filter receives the object values one by one as its first parameter. All remaining parameters provided to map_values
are passed down to the given filter. size
with dot notation when you need to use the filter inside a tag.where
that has no target value when that property is a boolean or truthy. For example, the available
property of products.01
to 31
01
to 12
21
2021
00
to 23
01
to 12
AM
or PM
am
or pm
00
to 59
00
to 59
1612328167
minus
is applied first, then times
, and finally divided_by
.Copyabs
will also work on a string if the string only contains a number.round
and to_fixed
it that round
returns a number so it trims trailing zeros while to_fixed
will preserve them.slice
filter returns a substring, starting at the specified index. An optional second parameter can be passed to specify the length of the substring. If no second parameter is given, a substring of one character will be returned.split
filter takes on a substring as a parameter. The substring is used as a delimiter to divide a string into an array. You can output different parts of an array using array filters.truncate
takes an optional second parameter that specifies the sequence of characters to be appended to the truncated string. By default this is an ellipsis (...), but you can specify a different sequence.truncate
, since the ellipsis counts as 3 characters.truncatewords
takes an optional second parameter that specifies the sequence of characters to be appended to the truncated string. By default this is an ellipsis (...), but you can specify a different sequence.url_encode
will turn a space into a +
sign instead of a percent-encoded character.