|
|
|
@ -8,7 +8,11 @@ class StoresController < ApplicationController
|
|
|
|
|
# include ActsAsTaggableOn::TagsHelper
|
|
|
|
|
|
|
|
|
|
def search
|
|
|
|
|
@searched_attach = Attachment.all[0..20]
|
|
|
|
|
name = params[:name] ||= ''
|
|
|
|
|
@searched_attach = Attachment.includes(:project).where("projects.is_public = ? AND filename LIKE '%"<< name <<"%' ", 1)
|
|
|
|
|
# @searched_attach = Attachment.all[0..20]
|
|
|
|
|
@searched_attach.take 20
|
|
|
|
|
# reutrn @searched_attach
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
LIMIT = 12 unless const_defined?(:LIMIT)
|
|
|
|
|