Rails を使用した Agile Web Development から Ruby on Rails を学び始めたところです。
ショッピング カート アプリケーションを実行しており、「カートを空にする」機能を実装中です。
<%= button_to 'Empty cart', @cart, method: :delete,
data: { confirm: 'Are you sure?' } %>
[カートを空にする] ボタンをクリックすると、カート コントローラーで破棄アクションが呼び出されます。
# DELETE /carts/1
# DELETE /carts/1.json
def destroy
  @cart = current_cart
  @cart.destroy
  @session[:cart_id] = nil
 respond_to do |format|
  format.html { redirect_to store_url, notice: 'Your cart is currently empty' }
  format.json { head :no_content }
 end
end
ここでは store_url にリダイレクトしますが、代わりにエラーが発生します。
テンプレートがありません {:locale=>[:en]、:formats=>[:html]、:handlers=>[:erb、:builder、:raw、:ruby、: jbuilder、:コーヒー]}。検索場所: * "/Users/anil20787/workspace/railsdir/depot/app/views"
rake ルートの出力は次のとおりです。
    Prefix Verb   URI Pattern                    Controller#Action
line_items GET    /line_items(.:format)          line_items#index
           POST   /line_items(.:format)          line_items#create
new_line_item GET    /line_items/new(.:format)      line_items#new
edit_line_item GET    /line_items/:id/edit(.:format) line_items#edit
 line_item GET    /line_items/:id(.:format)      line_items#show
           PATCH  /line_items/:id(.:format)      line_items#update
           PUT    /line_items/:id(.:format)      line_items#update
           DELETE /line_items/:id(.:format)      line_items#destroy
     carts GET    /carts(.:format)               carts#index
           POST   /carts(.:format)               carts#create
  new_cart GET    /carts/new(.:format)           carts#new
 edit_cart GET    /carts/:id/edit(.:format)      carts#edit
      cart GET    /carts/:id(.:format)           carts#show
           PATCH  /carts/:id(.:format)           carts#update
           PUT    /carts/:id(.:format)           carts#update
           DELETE /carts/:id(.:format)           carts#destroy
   store_index GET    /store/index(.:format)         store#index
  products GET    /products(.:format)            products#index
           POST   /products(.:format)            products#create
   new_product GET    /products/new(.:format)        products#new
  edit_product GET    /products/:id/edit(.:format)   products#edit
   product GET    /products/:id(.:format)        products#show
           PATCH  /products/:id(.:format)        products#update
           PUT    /products/:id(.:format)        products#update
           DELETE /products/:id(.:format)        products#destroy
     store GET    /                              store#index
私はthisとthisの投稿を見ましたが、これは私の問題に似ています。しかし、私は何をする必要があるかを理解できませんでした。
この問題を解決するための助けをいただければ幸いです。
編集: - redirect_to の周りに {} を追加しました - 「rake routes」出力を追加しました