undefined method where
使用这些参数运行以下代码时,我不断收到错误消息。
谁能看到我做错了什么?
谢谢
Parameters: {"category_ids"=>["1", "3", "4"]}
@pieces = Piece.all
@pieces = @pieces.where(:category_id => params[:category_ids]) if params[:category_ids].present?
@pieces = @pieces.where(:brand_id => params[:brand_ids]) if params[:brand_ids].present?
@pieces = @pieces.where(:color_id => params[:color_ids]) if params[:color_ids].present?
@pieces = @pieces.where(:user_id => params[:friend_ids]) if params[:friend_ids].present?