前提・実現したいこと
ルーティングの設定でエラーが出ます。
ご教示お願い致します。
発生している問題・エラーメッセージ
localhost:8881/indexにアクセスすると下記のエラーが出ました。
undefined local variable or method `helloctrl' for #<ActionDispatch::Routing::Mapper:0x00007ffa10d8f498>
該当のソースコード
正しくルーティングを設定しているつもりですが、何が間違っていますか?
・routes.rb
ruby
1Rails.application.routes.draw do 2 # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html 3 get 'index', to:helloctrl#index 4end
・helloctrl_controller.rb
ruby
1class HelloctrlController < ApplicationController 2 def index 3 myjson = {'departuredate' => params['departuredate'], 'list' => params['list']} 4 render :json => myjson 5 end 6end
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/01/29 08:30