From 52d3aca7b73cf3cad096fa8660cbae9e7de94307 Mon Sep 17 00:00:00 2001 From: Kensuke Kaneko Date: Thu, 21 Jan 2010 00:46:41 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BE=8B=E5=A4=96=E5=87=A6=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- depot/app/controllers/store_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/depot/app/controllers/store_controller.rb b/depot/app/controllers/store_controller.rb index 7b75024..fd8bc5f 100644 --- a/depot/app/controllers/store_controller.rb +++ b/depot/app/controllers/store_controller.rb @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- class StoreController < ApplicationController def index @products = Product.find_products_for_sale @@ -7,6 +8,10 @@ def add_to_cart product = Product.find(params[:id]) @cart = find_cart @cart.add_product(product) + rescue + logger.error("無効な商品#{params[:id]}にアクセスしようとしました") + flash[:notice] = "無効な商品です" + redirect_to :action => "index" end private