#1326 编辑帖子却不能编辑上传的附件 解决:添加编辑上传的附件功能
This commit is contained in:
parent
ddca1a0316
commit
30ae933e27
|
@ -148,6 +148,7 @@ class MemosController < ApplicationController
|
||||||
@memo.update_column(:sticky, params[:memo][:sticky]) &&
|
@memo.update_column(:sticky, params[:memo][:sticky]) &&
|
||||||
@memo.update_column(:lock, params[:memo][:lock]))
|
@memo.update_column(:lock, params[:memo][:lock]))
|
||||||
@memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads]))
|
@memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads]))
|
||||||
|
@memo.save
|
||||||
# @memo.root.update_attribute(:updated_at, @memo.updated_at)
|
# @memo.root.update_attribute(:updated_at, @memo.updated_at)
|
||||||
format.html {redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}"}
|
format.html {redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}"}
|
||||||
else
|
else
|
||||||
|
|
|
@ -26,6 +26,10 @@
|
||||||
</p>
|
</p>
|
||||||
<p><%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %></p>
|
<p><%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %></p>
|
||||||
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
|
<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/>
|
<br/>
|
||||||
<%= f.submit :value => l(:button_change) %> <%= link_to l(:button_back), back_url ,:class => "button-canel",:style => "color: #ffffff;"%>
|
<%= f.submit :value => l(:button_change) %> <%= link_to l(:button_back), back_url ,:class => "button-canel",:style => "color: #ffffff;"%>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue