I am trying to set up a route that looks like this: acme.com/posts/:category/:status . Both :category and :status are optional. I wrote a lot of variations, but no one worked:
resources :posts do match '(/:category)(/:status)', to: 'posts#index', as: 'filter', on: :collection end
The idea is to be able to: 1) filter by category, 2) filter by status, and 3) filter both by category and by status, if available. The current setting also violated my path /posts/new , always redirecting to posts#index .
source share