@@ -60,13 +60,15 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? |
|
63 | if request.post? | |
|
64 | @message.save_attachments(params[:attachments]) | |||
|
65 | if @message.save | |||
64 | call_hook(:controller_messages_new_after_save, { :params => params, :message => @message}) |
|
66 | 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 | render_attachment_warning_if_needed(@message) | |
67 | redirect_to :action => 'show', :id => @message |
|
68 | redirect_to :action => 'show', :id => @message | |
68 | end |
|
69 | end | |
69 | end |
|
70 | end | |
|
71 | end | |||
70 |
|
72 | |||
71 | # Reply to a topic |
|
73 | # Reply to a topic | |
72 | def reply |
|
74 | def reply |
@@ -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