前提・実現したいこと
上記エラーを解決したい
■ 調べた内容とそこから立てた仮説
gemファイルにgem 'haml-rails'を入れて rails haml:erb2hamlをおこない、
bundle installを行ったところ、上記の様なエラーが出ました。
コントローラーやモデルを作る必要があるのでしょうか?
■ 仮説を元に行った作業内容
・google翻訳
・カリキュラムの見直し
・Google検索
補足情報(FW/ツールのバージョンなど)
私のPC環境
ruby 2.6.3
Rails 5.2.4.1
発生している問題・エラーメッセージ
ActionController::UnknownFormat in PostsController#index PostsController#index is missing a template for this request format and variant. request.formats: ["text/html"] request.variant: [] NOTE! For XHR/Ajax or API requests, this action would normally respond with 204 No Content: an empty white screen. Since you're loading it in a web browser, we assume that you expected to actually render a template, not nothing, so we're showing an error to be extra-clear. If you expect 204 No Content, carry on. That's what you'll get from an XHR or API request. Give it a shot.
該当のソースコード
53 "That's what you'll get from an XHR or API request. Give it a shot." 54 55 raise ActionController::UnknownFormat, message 56 else 57 logger.info "No template found for #{self.class.name}\##{action_name}, rendering head :no_content" if logger 58 super raise ActionController::UnknownFormat, message else logger.info "No template found for #{self.class.name}\##{action_name}, rendering head :no_content" if logger super
回答2件
あなたの回答
tips
プレビュー