Preserve uploaded files when on documents.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8944 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-02-23 13:10:51 +00:00
parent 3871cbc75c
commit 8f24aa6c67
2 changed files with 3 additions and 3 deletions

View File

@ -52,8 +52,8 @@ class DocumentsController < ApplicationController
def create
@document = @project.documents.build(params[:document])
if request.post? and @document.save
attachments = Attachment.attach_files(@document, params[:attachments])
@document.save_attachments(params[:attachments])
if @document.save
render_attachment_warning_if_needed(@document)
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'index', :project_id => @project

View File

@ -10,6 +10,6 @@
<% if @document.new_record? %>
<div class="box tabular">
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form', :locals => {:container => @document} %></p>
</div>
<% end %>