diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index f149ad9b2..cee08ffa9 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -213,9 +213,9 @@ class AttachmentsController < ApplicationController def tip_attachment_update if params[:course_id] - @tip_all_attachments = Attachment.where(:container_type => "Course", :container_id => params[:project_id]) - @tip_all_public_attachments = Attachment.where(:container_type => "Course", :container_id => params[:project_id], :is_public => 1) - @tip_all_private_attachments = Attachment.where(:container_type => "Course", :container_id => params[:project_id], :is_public => 0) + @tip_all_attachments = Attachment.where(:container_type => "Course", :container_id => params[:course_id]) + @tip_all_public_attachments = Attachment.where(:container_type => "Course", :container_id => params[:course_id], :is_public => 1) + @tip_all_private_attachments = Attachment.where(:container_type => "Course", :container_id => params[:course_id], :is_public => 0) @course = Course.find(params[:course_id]) elsif params[:project_id] @tip_all_attachments = Attachment.where(:container_type => "Project", :container_id => params[:project_id]) diff --git a/app/views/files/_resource_detail.html.erb b/app/views/files/_resource_detail.html.erb index 715fb15aa..b60814afd 100644 --- a/app/views/files/_resource_detail.html.erb +++ b/app/views/files/_resource_detail.html.erb @@ -71,9 +71,9 @@
  • <% if params[:tag_name].blank? %> - <%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1), :course_id => course.id), :remote=>true,:class=>"postOptionLink",:method => :post %> + <%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1), :course_id => @course.id), :remote=>true,:class=>"postOptionLink",:method => :post %> <% else %> - <%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1), :tag_name => params[:tag_name].force_encoding("UTF-8"), :course_id => course.id, :other => params[:other]), :remote=>true,:class=>"postOptionLink",:method => :post %> + <%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1), :tag_name => params[:tag_name].force_encoding("UTF-8"), :course_id => @course.id, :other => params[:other]), :remote=>true,:class=>"postOptionLink",:method => :post %> <% end %>