调整应用的修改功能,使其可以更新重新上传的文件,但是会删除上次上传的文件
This commit is contained in:
parent
a90804b312
commit
c272d7a8c7
|
@ -76,7 +76,8 @@ class SoftapplicationsController < ApplicationController
|
|||
# PUT /softapplications/1.json
|
||||
def update
|
||||
# @softapplication = Softapplication.find(params[:id])
|
||||
|
||||
@softapplication.attachments.map{|attach| attach.destroy }
|
||||
@softapplication.save_attachments(params[:attachments])
|
||||
respond_to do |format|
|
||||
if @softapplication.update_attributes(params[:softapplication])
|
||||
format.html { redirect_to @softapplication, notice: 'Softapplication was successfully updated.' }
|
||||
|
|
Loading…
Reference in New Issue