Low commit activity in last 3 years
Liquid's sort and sort_natural don't support nested fields out of the box.This gems provides nested_sort and nester_sort_natural.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 4
 Project Readme

liquid-nested-sort

Gem Version

nested_sort and nested_sort_natural, sort and sort_natural-like filters with nested fields support for Liquid.

Installation

In the Gemfile

gem 'liquid-nested-sort'

Usage

{{ places | nested_sort "address.street" }}
{{ places | nested_sort_natural "address.street" }}

Thanks

This is mostly based on @untra's work (https://github.com/untra).