Setting The Default Page
Goals
Steps
Step 1: Add a root route
Rails.application.routes.draw do root 'topics#index' resources :topics # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html endStep 2: Remove the comment (optional)
Step 3: Confirm your changes
For Cloud9: delete any text after 'amazonaws.com', or click to preview running application in the editor again
Explanation
Terminal$ rails routes Prefix Verb URI Pattern Controller#Action root GET / topics#index topics GET /topics(.:format) topics#index POST /topics(.:format) topics#create new_topic GET /topics/new(.:format) topics#new edit_topic GET /topics/:id/edit(.:format) topics#edit topic GET /topics/:id(.:format) topics#show PATCH /topics/:id(.:format) topics#update PUT /topics/:id(.:format) topics#update DELETE /topics/:id(.:format) topics#destroyFor Cloud9:
Step 4: Exploring Routes (optional)
Terminal$ rails consoleIRB> app.topics_path => "/topics" > app.topics_url => "http://www.example.com/topics"
Next Step:
Go on to Voting On Topics
Back to CRUD With Scaffolding