##// END OF EJS Templates
Preserve uploaded files when creating a forum topic....
Jean-Philippe Lang -
r8820:435a634ac718
parent child
Show More
@@ -60,11 +60,13 class MessagesController < ApplicationController
60 60 @message.locked = params[:message]['locked']
61 61 @message.sticky = params[:message]['sticky']
62 62 end
63 if request.post? && @message.save
64 call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
65 attachments = Attachment.attach_files(@message, params[:attachments])
66 render_attachment_warning_if_needed(@message)
67 redirect_to :action => 'show', :id => @message
63 if request.post?
64 @message.save_attachments(params[:attachments])
65 if @message.save
66 call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
67 render_attachment_warning_if_needed(@message)
68 redirect_to :action => 'show', :id => @message
69 end
68 70 end
69 71 end
70 72
@@ -24,5 +24,5
24 24 <!--[eoform:message]-->
25 25
26 26 <p><%= l(:label_attachment_plural) %><br />
27 <%= render :partial => 'attachments/form' %></p>
27 <%= render :partial => 'attachments/form', :locals => {:container => @message} %></p>
28 28 </div>
General Comments 0
You need to be logged in to leave comments. Login now