前提・実現したいこと
Ruby on rails5 アプリケーションプログラミングという本の2章にて
テンプレートファイルをプラウザーからアクセスできるようにしたい。
発生している問題・エラーメッセージ```
コード
(controller.rb) class HelloController < ApplicationController def view @msg = 'こんにちは、世界!' end end (routes.rb) Rails.application.routes.draw do get 'hello/show' # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html get 'hello/view' end (hello/view.html.erb) <div id="main"> <%= @msg %> </div>
エラーメッセージ
HelloController#view 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.
補足情報(FW/ツールのバージョンなど)
erbはAtomにて作成しました。他のアドレスにはrailsでアクセスできており、これだけができません。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。