localhost:3000/posts
에서 간단한 블로그 게시물을 실행하려고합니다.템플릿에 누락 오류가 있습니다.
페이지에 액세스하려고하면이 오류가 발생합니다.
class PostsController < ApplicationController
def index
end
end
내가 내
c:/Sites/myrubyblog/app/views
디렉토리에
index.html.erb
파일을 가지고, 그래서 이런 일이 왜 확실하지 않다 : 여기
Template is missing
Missing template posts/index, application/index with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "c:/Sites/myrubyblog/app/views"
내
posts_controller.rb
의 코드의 복사본입니다.
누구든지이 문제를 해결하려면 어떻게해야합니까?
주목할 사실 하나; 어떤 이유로 포스트 컨트롤러 디렉토리 이름을 변경해야한다면 뷰 디렉토리 이름이 현재 컨트롤러와 일치하더라도 해당 컨트롤러에 대한 모든보기를 다시 만들어야합니다. 그냥 뭔가 문제가 있었고 재현하여 작업했습니다. – Jbur43