sql 转义字符跑错的问题

exceptionHandle
yanxd 12 years ago
parent 79e01adb91
commit b2bdf0c640

@ -8,7 +8,7 @@ class StoresController < ApplicationController
name = params[:name] ||= ''
redirect_to stores_path, :notice => l(:field_course_un) if name.blank?
# 按文件名搜索
result = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE '%" + name + "%' ").
result = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE :like ", like: "%#{name}%").
reorder("created_on DESC")
# result = result.to_a
result.map { |res|

Loading…
Cancel
Save