No template found for AAController#BB
railsのcontroller
にて特定のメソッドを定義したにも関わらず、設定したアクションが行われないケースにおいて、terminalを覗くとこのような記述がある場合の解決法
BB.html.erbを作成
Rails 5 No template found errorより
Rails looks for a view file to render when a action is called, and it's looking for a file with the same name as the action.
Railsはアクションが呼ばれた際にそれに該当する同名のファイルを探すので、ファイルをview directoryに作成すれば解決するとのこと。
redirect_toの記述忘れ
僕の場合はこちらでした。
update
アクションを記述する際に
def update
@cart = session[:cart].map { |item_id| Item.find(item_id) }
@cart.delete(params[:id])
redirect_to cart_index_path #ココ!
end
メソッドを実行した際の戻り値?、帰るパスを設定し忘れていたので変化が発生せずにterminalにてエラーが出ていたようでした。