Steps
Step 1: Add a root route
Rails.application.routes.draw do root 'topics#index'
Step 2: Confirm your changes
More at http://docs.railsbridge.org/intro-to-rails/setting_the_default_page
Chee Chong Hwa aka CCH, a Malaysian Chief Software Architect blogs on his experiences with Ruby on Rail running on Win2003 Server+Apache 2.26 environment since 2007. Flirted briefly with Ubuntu 9.04 in 2009. Since January 2017, now using RubyMine IDE/Notepad++ to work with Ruby 2.26 +Rails 5.01+Apache 2.4.23 + MySQL 5.7.14 on Windows 10 64-bits.
Step 1: Add a root route
Open the fileconfig/routes.rb
in an editor (eg NotePad++)Look for the lineRails.application.routes.draw
at the beginning of the file, and add the lineroot 'topics#index'
after it. When you are done the start of the file should look like this:Rails.application.routes.draw do root 'topics#index'
Step 2: Confirm your changes
Go back to http://localhost:3000/. You should be taken to the topics list automatically.
No comments:
Post a Comment