When I check error log I see HomeController#index
, I would like you to check rails routes
first. You should see a result similar to this:
Prefix Verb URI Pattern Controller#Action
home_index GET /home/index(.:format) home#index
...
If you are seeing homecontroller#index
instead of home#index
you can access by going to related URI pattern.
You can control which files are created when you run rails generate
command. This is a sample output:
? rails g controller home index
Running via Spring preloader in process 1934
create app/controllers/home_controller.rb
route get 'home/index'
invoke erb
create app/views/home
create app/views/home/index.html.erb
invoke helper
create app/helpers/home_helper.rb
invoke assets
invoke scss
create app/assets/stylesheets/home.scss
As you see there is a file app/views/home/index.html.erb
make sure that it is not empty. For example put <p>Home</p>
in this file, if it is empty.
I hope it is clear enough and I think this will solve your problem.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…