From 1fee210924eeb92a59a0e9fa885b82a7fd95bf5e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Nov 2014 16:51:22 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=96=B0=E5=BB=BA=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A=E6=8F=90=E4=BA=A4=E3=80=81?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F=202.?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A=E6=97=B6=E5=85=B3=E8=81=94?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BC=9A=E8=87=AA=E5=8A=A8=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 11 +---------- app/views/homework_attach/edit.html.erb | 4 ++-- app/views/homework_attach/new.html.erb | 4 ++-- public/stylesheets/css.css | 2 +- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index a9adc9ec6..ff6463036 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -331,18 +331,9 @@ class HomeworkAttachController < ApplicationController if User.current.admin? || User.current.member_of_course?(course) name = params[:homework_name] description = params[:homework_description] - if params[:homework_attach] - if params[:homework_attach][:project_id] - project_id = params[:homework_attach][:project_id] - else - project_id = 0 - end - else - project_id = 0 - end @homework.name = name @homework.description = description - @homework.project_id = project_id + @homework.project_id = params[:project_id] || 0 if params[:attachments] @homework.save_attachments(params[:attachments]) end diff --git a/app/views/homework_attach/edit.html.erb b/app/views/homework_attach/edit.html.erb index 92a72acd4..cfe4bf097 100644 --- a/app/views/homework_attach/edit.html.erb +++ b/app/views/homework_attach/edit.html.erb @@ -41,13 +41,13 @@