true
, this filter will interpret the first line of input as containing headers for the CSV table, and will return an array of hashes whose keys map to items in that header row.tz
option, which accepts a timezone name from the TZ database. If given, the resulting time string will be in the specified timezone. If this option is not provided, the store's local timezone will be used instead."now"
, and values offset from now, as in "now + 5 days"
or "now - 5 weeks"
. In this way, the filter supports simple date math. Note that durations are calculated using variable duration lengths, given the naturally varying length of specific days, weeks, months, and years, given DST and other calendar variances, all informed by the store's timezone. This math is backed by ActiveSupport::TimeWithZone#+. An example, quoting from that documentation: "a time + 24.hours will advance exactly 24 hours, while a time + 1.day will advance 23-25 hours, depending on the day"."01/01/01"
.nil
, false
, or an empty string ""
β it returns its argument.force_utf8: false
option. Use this when you're certain the original encoding must be preserved, if you ultimately intend to pass along the string in a JSON-friendly representation. (For example, you might gunzip a value, and then use the base64 filter to represent it safely within JSON.)silent: true
to the filter's options:"data"
and "errors"
.variables
.nil
.binary: true
to the filter's options.first
or last
in dot notation inside of tags.name
) and values (e.g. matt
), we can use map
to get a new array of values for a specific attribute of the objects in the array. In the below example, we have an array of products, and each product has a title. Using map
we can create a new array of only product titles.