I am trying to create a Rails route that has optional parameters as well as varying order.
This question describes a similar problem: Routes with multiple, optional, and pretty parameters
I am trying to create routes that have map filters in them, like parameters but without the parameter URL styling. The idea is to have them look like
/search/country/:country/
/search/country/:country/state/:state/
/search/country/:country/state/:state/loc/:lat/:long/
but you should also be able to search with
/search/state/:state/
/search/state/:state/country/:country/
/search/loc/:lat/:long/
I know that I could write complex regex statements with route globbing - however I'm wondering if there is a way to have multiple optional route parameters with unspecified order, something like
/search/( (/country/:country)(/state/:state)(/loc/:lat/:long) )
Thanks!
routes.rb- RPinel