From 42d0f420a8cc650acd18f41476a516147dee0c28 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 29 Sep 2014 11:59:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B4=B4=E5=90=A7=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=88=A0=E9=99=A4=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=8C=E7=AB=9E=E8=B5=9B=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E5=88=A0=E9=99=A4=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 079a4e822..215df8e10 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -193,12 +193,14 @@ class AttachmentsController < ApplicationController else format.html { redirect_to_referer_or course_path(@course) } end + elsif !@attachment.container.nil? && @attachment.container.is_a?(Softapplication) + format.html { redirect_to_referer_or softapplications_path(@attachment.container) } else - # if @project.nil? - # format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) } - # else + if @project.nil? + format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) } + else format.html { redirect_to_referer_or project_path(@project) } - # end + end end format.js