修复竞赛作品附件删除报错的bug

Signed-off-by: alan <547533434@qq.com>
course_group
alan 11 years ago
parent b35defe270
commit 43e940eb1d

@ -1,5 +1,5 @@
# source 'http://ruby.taobao.org' source 'http://ruby.taobao.org'
source 'http://ruby.sdutlinux.org/' #source 'http://ruby.sdutlinux.org/'
unless RUBY_PLATFORM =~ /w32/ unless RUBY_PLATFORM =~ /w32/
# unix-like only # unix-like only
@ -30,6 +30,7 @@ group :test do
gem 'factory_girl', '~> 4.4.0' gem 'factory_girl', '~> 4.4.0'
gem 'selenium-webdriver', '~> 2.42.0' gem 'selenium-webdriver', '~> 2.42.0'
platforms :mri, :mingw do platforms :mri, :mingw do
group :rmagick do group :rmagick do
# RMagick 2 supports ruby 1.9 # RMagick 2 supports ruby 1.9
@ -48,6 +49,7 @@ group :development, :test do
gem 'ruby-prof', '~> 0.15.1' unless RUBY_PLATFORM =~ /w32/ gem 'ruby-prof', '~> 0.15.1' unless RUBY_PLATFORM =~ /w32/
gem 'pry' gem 'pry'
gem 'pry-nav' gem 'pry-nav'
end end

@ -19,7 +19,7 @@ PATH
rails rails
GEM GEM
remote: http://ruby.sdutlinux.org/ remote: http://ruby.taobao.org/
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actionmailer (3.2.13) actionmailer (3.2.13)

@ -194,11 +194,11 @@ class AttachmentsController < ApplicationController
format.html { redirect_to_referer_or course_path(@course) } format.html { redirect_to_referer_or course_path(@course) }
end end
else else
if @project.nil? # if @project.nil?
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) } # format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
else # else
format.html { redirect_to_referer_or project_path(@project) } format.html { redirect_to_referer_or project_path(@project) }
end # end
end end
format.js format.js

Loading…
Cancel
Save