Reputation: 20269
I want such a routing table:
"/search" => "search#home" # Without GET params, call action "home".
"/search?*" => "search#result" # Call "result" action when search has params.
Is it possible to do that?
Upvotes: 3
Views: 1541
Reputation: 160291
One way would be to use an advanced constraint.
Check for the presence of a query string. I think you'd need to put this ahead of the home route.
(This is all untested/unconfirmed.)
Upvotes: 1