Apply multiple filtering options
I have an events page with two distinct filtering options. One filters by
'period', the other by 'tag'.
The period filter is performed via a GET request and the tag filter uses a
form to POST its value.
The defined routes for events:
resources :events
post 'tags/(:tag)', to: 'events#index', as: :tag
get 'events(/period/:period)', to: 'events#index', as: :events_period
My tag filtering uses the tag_path to submit itself:
<%= form_tag tag_path, method: :post, do %>
Both filtering actions are dealt with by the index action in the
EventsController.
What I want to do is remember the filtering of period while filtering for
tags. In other words, when the url is /period/past and the meh tag is
selected, I would like to apply both filtering options.
No comments:
Post a Comment