Skip to content

Instantly share code, notes, and snippets.

@julianrubisch
Created February 22, 2021 14:07
Show Gist options
  • Save julianrubisch/172cfc1c584ad6b279478c071ccd9858 to your computer and use it in GitHub Desktop.
Save julianrubisch/172cfc1c584ad6b279478c071ccd9858 to your computer and use it in GitHub Desktop.
class FilterReflex < ApplicationReflex
include Filterable
def filter
resource, param = element.dataset.to_h.fetch_values(:resource, :param)
value = element.dataset.value || element.value
set_filter_for(resource, param, value)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment