From 8815e99db53ec19f7d1734bc937c21f26280f350 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 3 Mar 2016 17:25:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E4=B8=8A=E4=BC=A0=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 23 ++++++++----------- .../users/_import_resource_info.html.erb | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d94615791..0bbdacff8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2283,20 +2283,17 @@ class UsersController < ApplicationController @save_message = attach_copied_obj.errors.full_messages end end - if params[:mul_type] == "Course" - respond_to do |format| - redirect_to course_files_url(mul_container) - end - elsif params[:mul_type] == "Project" - respond_to do |format| - redirect_to project_files_url(mul_container) - end - elsif params[:mul_type] == "SubfieldFile" - respond_to do |format| - redirect_to org_subfield_files_url(mul_container) - end + respond_to do |format| + format.html { + if params[:mul_type] == "Course" + redirect_to course_files_url(mul_container) + elsif params[:mul_type] == "Project" + redirect_to project_files_url(mul_container) + elsif params[:mul_type] == "SubfieldFile" + redirect_to org_subfield_files_url(mul_container) + end + } end - end # 根据资源关键字进行搜索 diff --git a/app/views/users/_import_resource_info.html.erb b/app/views/users/_import_resource_info.html.erb index 270f0956b..a28d9d534 100644 --- a/app/views/users/_import_resource_info.html.erb +++ b/app/views/users/_import_resource_info.html.erb @@ -32,7 +32,7 @@ <%= form_tag( url_for({:controller => 'users', :action => 'import_into_container', :mul_id => params[:project_id].nil? ? (params[:course_id].nil? ? params[:subfield_file_id] : params[:course_id]) : params[:project_id], :mul_type => params[:project_id].nil? ? (params[:course_id].nil? ? "SubfieldFile" : "Course") : "Project"}), - :remote => true , :method => 'post', :id => 'resource_import_container_form') do %> + :method => 'post', :id => 'resource_import_container_form') do %> <% @attachments.each do |attach| %>