Created
February 22, 2021 14:07
-
-
Save julianrubisch/172cfc1c584ad6b279478c071ccd9858 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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