修改可对文件进行增、删等操作

president
sw 11 years ago
parent 29ac5ff12a
commit 80afefcd28

@ -70,7 +70,9 @@ class HomeworkAttachController < ApplicationController
description = params[:homework_description] description = params[:homework_description]
@homework.name = name @homework.name = name
@homework.description = description @homework.description = description
#@homework.save_attachments(params[:attachments]) if params[:attachments]
@homework.save_attachments(params[:attachments])
end
if @homework.save if @homework.save
respond_to do |format| respond_to do |format|
format.html { redirect_to project_for_bid_path @homework.bid } format.html { redirect_to project_for_bid_path @homework.bid }

@ -102,12 +102,12 @@
<!-- <!--
<tr> <tr>
<td colspan="2" width="580px" > <td colspan="2" width="580px" >
<% if (User.current == homework.user) || (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',3,7, 9)).size >0) %> <% if (User.current == homework.user) || (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',3,7, 9)).size >0) %>
<p class="font_description"> <p class="font_description">
<% options = {:author => true, :deletable => attach_delete(homework)} %> <% options = {:author => true, :deletable => attach_delete(homework)} %>
<%= render :partial => 'attachments/links', <%= render :partial => 'attachments/links',
:locals => {:attachments => homework.attachments, :options => options} %> :locals => {:attachments => homework.attachments, :options => options} %>
</p> </p>
<% end %> <% end %>
</td> </td>

Loading…
Cancel
Save