Commit a163d341 by Nguyen Quoc Kien

Fixed find_product #2

parent 6e7cea70
......@@ -45,6 +45,8 @@ class ApplicationController < ActionController::Base
def find_product
if params[:id].to_i > (Product.count + 1)
redirect_to error_path
elsif is_number?(params[:id]) == false
redirect_to error_path
else
@product = Product.find(params[:id])
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment