ruby on rails - Where should a root be located in your routes.rb file? -
probably trivial wondering root key word along controller action should placed within routes.rb file.
rails.application.routes.draw 'welcome/index' root 'welcome#index' end
i've taken @ couple of tutorials , of them seem have @ bottom. there reason this?
according rails routing guide
you should put root route @ top of file, because popular route , should matched first.
and partial reasoning is
rails routes matched in order specified...
so, want commonly used routes on/high in file, don't have go through , waste time checking lot of uncommon or downright rare routes.
Comments
Post a Comment