0

It is showing me "StoresController#pages is missing a template for request formats: text/html" even though everything is correct, I added navbar and devise and simple forms and it was working perfectly fine in morning (about 7 hours ago), then now when i start the server it shows this error! any fixes??

stores_controller.rb

class StoresController < ApplicationController
  def index
  end
end

views/stores/index.html.erb

<h1>Store#index</h1>
<p>Find me in app/views/store/index.html.erb</p>

config/routes.rb

Rails.application.routes.draw do
  devise_for :users, controllers: { registrations: 'registrations' } 

  devise_scope :user do
    get '/users/sign_out' => 'devise/sessions#destroy'
  end

  root 'store#index'

end

Screenshot

I tried restarting the server multiple times with different terminals, with VScode and with Git Bash both, but it didn't work and it shows the same error!

Morning it was working absolutely fine and i even added devise, simple_form and added navbar and it was working, then after 7 hours now when i started the server,it is showing me this error

1 Answer 1

1

View directory should be named same as the controller name, in your case you should name your view directory as stores, not store

More information can be found here: https://guides.rubyonrails.org/layouts_and_rendering.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.