UnlnownFormat エラー解決

f:id:khirok:20200103102506p:plain

InformationsController#index is missing a template for this request

Informationsコントローラーのindexアクションがこのリクエストに対して、テンプレートが欠けている。

 

ルーティングはこちら

Rails.application.routes.draw do
get "/" => "informations#index"
end

おそらく、このリクエストは通っている。

 

コントローラーはこちら

class InformationsController < ApplicationController
 def index
 end
end

こちらも問題なし。

 

結局原因は、ビューファイルの名前でした。

 

index.erb.htmlをindex.html.erbに修正したら解決しました。

indexのすぐ後にhtmlと書かないと、railsがhtmlファイルと認識できないみたいです。

f:id:khirok:20200103110620p:plain

 

以上。