module ActionDispatch::Routing::Mapper::Base

def root(options = {})

of most Rails applications, this is beneficial.
because this means it will be matched first. As this is the most popular route
You should put the root route at the top of config/routes.rb,

For options, see the +match+ method's documentation, as +root+ uses it internally.

root :to => 'pages#main'

You can specify what Rails should route "/" to with the root method:
def root(options = {})
  match '/', options.reverse_merge(:as => :root)
end