CDRH / orchid

Rails Engine for site integration with CDRH API
MIT License
3 stars 0 forks source link

Sort customization for Search Presets #278

Open techgique opened 1 year ago

techgique commented 1 year ago

Currently the sort helper code checks if rendering a page for a Section: https://github.com/CDRH/orchid/blob/dev/app/helpers/orchid/sort_helper.rb#L49 If there is a section in use, it will call a separate helper method prefixed with the section name for custom sorting.

We could add similar code to check for an instance variable like @search_preset defined in the controller alongside other search preset code. Then we could call a separate helper method prefixed with this search preset name for custom sorting as well.

This isn't an urgent need, but a place to outline how to build such a feature if/when we need it.