From b6de2dbd2d7376b4c36dbf8cc9070fbd140e5dd4 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 25 May 2016 09:44:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BD=9C=E4=B8=9A=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 1 + app/views/users/_user_homework_attachment.html.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 203296160..1e12db25d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1096,6 +1096,7 @@ class UsersController < ApplicationController #引入资源列表根据关键词过滤 def user_ref_resource_search search = params[:search].to_s.strip.downcase + @user = User.current if(params[:type].blank? || params[:type] == "1") #全部 user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 取交集并查询 @attachments = Attachment.where("((author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb index 9f9aea60f..669e7aa91 100644 --- a/app/views/users/_user_homework_attachment.html.erb +++ b/app/views/users/_user_homework_attachment.html.erb @@ -70,7 +70,7 @@
上传附件 - <%= link_to "资源库",{:controller => 'users', :action => 'user_ref_resource_search', :id => User.current.id, :homework_id => container.id, :type => nil}, :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作品的附件", :remote => true %> + <%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作品的附件", :remote => true %> <% if defined?(has_program) && has_program %>