##// 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 @message.locked = params[:message]['locked']
60 @message.locked = params[:message]['locked']
61 @message.sticky = params[:message]['sticky']
61 @message.sticky = params[:message]['sticky']
62 end
62 end
63 if request.post? && @message.save
63 if request.post?
64 call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
64 @message.save_attachments(params[:attachments])
65 attachments = Attachment.attach_files(@message, params[:attachments])
65 if @message.save
66 render_attachment_warning_if_needed(@message)
66 call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
67 redirect_to :action => 'show', :id => @message
67 render_attachment_warning_if_needed(@message)
68 redirect_to :action => 'show', :id => @message
69 end
68 end
70 end
69 end
71 end
70
72
@@ -24,5 +24,5
24 <!--[eoform:message]-->
24 <!--[eoform:message]-->
25
25
26 <p><%= l(:label_attachment_plural) %><br />
26 <p><%= l(:label_attachment_plural) %><br />
27 <%= render :partial => 'attachments/form' %></p>
27 <%= render :partial => 'attachments/form', :locals => {:container => @message} %></p>
28 </div>
28 </div>
General Comments 0
You need to be logged in to leave comments. Login now