Berry Berry - 2 months ago 13
Ruby Question

ruby on rails/Template is missing

I am a very beginner of using ruby on rails. I am trying to build my first full-stack app but I have an error of

Missing template tweets/index
.

Here is my controller:
controller

Here is my view:
view

And here is my routes:

Rails.application.routes.draw do
root to: 'tweets#index'
get 'tweets', to: 'tweets#index'
end


I am really confused. Please help

Answer

From the tree view of your text editor, it looks like index.html.erb isn't inside the tweets folder. ie. It is on the same level as that of the tweets folder(outside it).

Move it to the tweets folder and it should work.

Comments