From 18762e2da76b43519b52247fb6379d33d90c1fb8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 20 Jun 2014 13:52:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E3=80=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=97=B6=E6=8F=90=E4=BA=A4=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A9=BA=E5=80=BC=E9=80=89=E6=8B=A9=EF=BC=8C?= =?UTF-8?q?=E5=8D=B3=E4=B8=8D=E9=80=89=E5=AE=9A=E4=BB=BB=E4=BD=95=E5=85=B3?= =?UTF-8?q?=E8=81=94=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/homework_attach_helper.rb | 4 ++++ app/views/homework_attach/new.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/homework_attach_helper.rb b/app/helpers/homework_attach_helper.rb index fe7f123b..3510dc78 100644 --- a/app/helpers/homework_attach_helper.rb +++ b/app/helpers/homework_attach_helper.rb @@ -59,7 +59,11 @@ module HomeworkAttachHelper cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" memberships = User.current.memberships.all(:conditions => cond) projects = memberships.map(&:project) + not_have_project = [] + not_have_project << "<>" + not_have_project << 0 type = [] + type << not_have_project projects.each do |project| if project != nil option = [] diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb index 46ab0ce8..8ec0eb0b 100644 --- a/app/views/homework_attach/new.html.erb +++ b/app/views/homework_attach/new.html.erb @@ -28,7 +28,7 @@

提交项目: - <%= f.select :project_id, options_for_select(user_projects_option),:name => "project_id", :required => true%> + <%= f.select :project_id, options_for_select(user_projects_option),:name => "project_id", :required => true, :style => "width:490px;"%> <%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %>

提交项目可以为空