I need to conditionally set the param
option in routes.
Without condition it's easy:
resources :foo, param: :uuid do
#...
end
What I ideally want is something along the following lines (not working obviously):
resources :foo, param: ->(req) { req.env['PATH_INFO'].match?(/bar/) ? :uuid : :id } do
#...
end