https://www.rubylife.jp/rails/ini/index4.htmlを見ながらRuby on Railsの勉強をしています。
アクションの作成が終わり、ルーティングの設定を行っていたのですがbooks/app/config/routes.rbを開いても
Books::Application.routes.draw doと記述されておらず、Rails.application.routes.draw doを記述されていました。
Ruby
Books::Application.routes.draw do match 'hello' => 'booklist#hello' match 'bye' => 'booklist#bye' end ```routes.rbには上のコードをコピペしてWeblickサーバーを立ち上げたのですが、 Exiting C:/Ruby/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/mapper.rb:79:in `check_via': You should not use the `match` method in your router without specifying an HTTP method. (ArgumentError) If you want to expose your action to both GET and POST, add `via: [:get, :post]` option. If you want to expose your action to GET, use `get` in the router: Instead of: match "controller#action" Do: get "controller#action" from C:/Ruby/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/mapper.rb:1841:in `map_match' from C:/Ruby/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/mapper.rb:1597:in `match' from c:/rails_code/books/config/routes.rb:3:in `block in <top (required)>'... と表示されうまくいきませんでした。 ちなみに、コントローラには ```Ruby class BooklistController < ApplicationController def hello render "booklist/hello" end end ```と記述しています。環境はWindows 10、ruby 2.4.2、Rails 5.1.4です。 おわかりの方いらっしゃいましたらご教授お願いいたします。
まだ回答がついていません
会員登録して回答してみよう