In the following, what is the reason for having
This is the full equivalent of the code you provided:
Rails.application.routes.draw do get '/', to: 'static_pages#home' get 'static_pages/help', to: 'static_pages#help' get 'static_pages/about', to: 'static_pages#about' end
The hash symbol
# divides controller and action names in route destination string.
In your example you use the
root method. It is a shorthand for
get '/'. So you don't specify the request path.
In the last two rules, destination can be omitted because Rails calculates it automatically.
I suggest that you read the official Rails routing guide. It explains all these things.