diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index 0a00238..9f199a5 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -320,9 +320,8 @@ class CmsController < MyProfileController def media_upload files_uploaded = [] parent = check_parent(params[:parent_id]) - files = [:file1,:file2, :file3].map { |f| params[f] }.compact if request.post? - files.each do |file| + params[:images].each do |file| files_uploaded << UploadedFile.create(:uploaded_data => file, :profile => profile, :parent => parent) unless file == '' end end diff --git a/app/views/cms/_text_editor_sidebar.html.erb b/app/views/cms/_text_editor_sidebar.html.erb index deb01b2..590c138 100644 --- a/app/views/cms/_text_editor_sidebar.html.erb +++ b/app/views/cms/_text_editor_sidebar.html.erb @@ -16,9 +16,7 @@ "type='Folder' or type='Gallery'" ) %> -

<%= file_field_tag('file1') %>

-

<%= file_field_tag('file2') %>

-

<%= file_field_tag('file3') %>

+

<%= file_field_tag('images[]', :multiple => true) %>

<% button_bar do %> <%= submit_button(:save, _('Upload')) %> <% end %> -- libgit2 0.21.2