Ensure that a Sinatra hash always has a valid value
I'd write this in multiple lines, so that you don't have to write out the complex conversion multiple times:

v = (params[:v] || :list).downcase.to_sym
params[:v] = if %i[icons list].include?(v) then v else :list end