summaryrefslogtreecommitdiffstats
path: root/app/controllers/attachments_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/attachments_controller.rb')
-rw-r--r--app/controllers/attachments_controller.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 1c79ff4b3..8f3fcd82e 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -114,11 +114,9 @@ class AttachmentsController < ApplicationController
# Update all the attachments of a container
def update_all
- if params[:attachments].is_a?(Hash)
- if Attachment.update_attachments(@attachments, params[:attachments])
- redirect_back_or_default home_path
- return
- end
+ if Attachment.update_attachments(@attachments, update_all_params)
+ redirect_back_or_default home_path
+ return
end
render :action => 'edit_all'
end
@@ -225,4 +223,9 @@ class AttachmentsController < ApplicationController
'attachment'
end
end
+
+ # Returns attachments param for #update_all
+ def update_all_params
+ params.permit(:attachments => [:filename, :description]).require(:attachments)
+ end
end