[ToDoList] Introduction to Routing
Basic Routes As moving and seminal as the Rails welcome page is, we probably want something a bit more personal as our homepage (site root). This can be quickly achieved by editing just two files that already exist in our app, starting with /config/routes.rb : config/routes.rb Rails.application.routes.draw do get "up" => "rails/health#show", as: :rails_health_check root 'pages#hello' ## in controller#method format (snake_case) end This will send all requests to the root (homepage) of the site to the #hello method in the PagesController . We can see if this worked by consulting the Rails routes table and seeing this entry in the resulting output: $ bundle exec rails routes Prefix Verb URI Pattern Controller#Action root GET / pages#hello (If the output of the c...