1.NOTFOUND

class CartsController < ApplicationController
    before_action :set_cart, only: [:show, :edit, :update, :destroy]
    rescue_from ActiveRecord::RecordNotFound, with: :invalid_cart
    def invalid_cart
        logger.error "Attempt to access invalid cart #{params[:id]}"
        redirect_to store_url, notice: 'Invalid cart'
    end
end

天赢金创
338 声望21 粉丝

天赢金创,天赢金创,天赢金创,天赢金创,天赢金创,天赢金创天赢金创,天赢金创


引用和评论

0 条评论