From 2e36cf6d6adc7771aaf68b4c804468673c91ff7a Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 2 Sep 2016 12:12:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90=E5=BA=93?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B5=84=E6=BA=90=E6=8F=90=E7=A4=BA=E5=8F=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 6 +++--- app/views/files/_resource_detail.html.erb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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 %>