Ruby / Rails / v5 - Routing Order - Root
Does the order of my routes file matter?
yes, it does in some cases where you're using a variable in the url.
Say you have a routes file like this:
get ':page', to: "ages#page" get 'about', to: "pages#about"
The second one will never get hit because the first is catching the string
about in the parameter
root 'static_pages#landing' is the same as
get '/', to: "static_pages#landing". Since this matches for an exact string (
/) with no variables, it won't interfere with your other routes.