Skip to content

link_to with filter param #1517

Answered by adrianthedev
lpe asked this question in Help
Jan 6, 2023 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

So the easiest way to do that is to go to an Index page, set the filters how you want them, and then grab the link from the URL bar.
That link will always take you to the same state of the filters as long as you don't change anything to that filter (like the options).

I'll explain a bit about how they work.
You first configure a filer using the query and options methods. You add it to a resource and then you get to use it.
When you use it (let's say you're toggling an option to true), that filter class and that value, get added to a hash alongside with all other fields you have on your resource. Then they get base64 encoded and added to the filters URL param. The controller then fetches t…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@adrianthedev
Comment options

@lpe
Comment options

@adrianthedev
Comment options

@niclas
Comment options

@adrianthedev
Comment options

Answer selected by lpe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants