:via => [:options] in ruby on rails routes
As per the HTTP spec (and explained a bit more here), there is an OPTIONS verb - which routes can support.
The impetus for using OPTIONS is to request documentation for a web service API; results are meant to provide information regarding how the API may be used.
ActionDispatch::Routing::HTTP_METHODS
=> [:get, :head, :post, :put, :delete, :options]
To get back to your question, in a typical browser GET request, the first route will be used. When an OPTIONS request is made, the second route will be used.