I have just tested the following route in my Rails 4 app.
get "packages(/:display)", to: "packages#index", defaults: { display: "grid" }
/packages
:params[:display]
is"grid"
/packages/list
:params[:display]
is"list"
It's likely you have other routes playing into this still, preventing the same results I lay out above.
Short of finding such conflicts, how about we avoid the optional segment (the result is the same as above)?
get "packages", to: "packages#index", display: "grid"
get "packages/:display", to: "packages#index"