#1326 编辑帖子却不能编辑上传的附件 解决:添加编辑上传的附件功能

This commit is contained in:
z9hang 2014-10-08 15:36:58 +08:00
parent ddca1a0316
commit 30ae933e27
2 changed files with 5 additions and 0 deletions

View File

@ -148,6 +148,7 @@ class MemosController < ApplicationController
@memo.update_column(:sticky, params[:memo][:sticky]) &&
@memo.update_column(:lock, params[:memo][:lock]))
@memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads]))
@memo.save
# @memo.root.update_attribute(:updated_at, @memo.updated_at)
format.html {redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}"}
else

View File

@ -26,6 +26,10 @@
</p>
<p><%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %></p>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
<p>
<%= l(:label_attachment_plural) %><br />
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</p>
<br/>
<%= f.submit :value => l(:button_change) %>&nbsp;&nbsp;<%= link_to l(:button_back), back_url ,:class => "button-canel",:style => "color: #ffffff;"%>
</div>