From b3489d3e6819941c961e4c318f22075a35a13432 Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 20 May 2014 11:36:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8E=E8=B7=B3=E8=BD=AC=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 51259bb5d..d848b3c37 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -124,7 +124,12 @@ class AttachmentsController < ApplicationController end respond_to do |format| - format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum,@attachment.container) } + 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 + format.js end end