diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 6ed42bd6e..7b375377c 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -392,8 +392,8 @@ class FilesController < ApplicationController sort = "#{Attachment.table_name}.created_on desc" end @container_type = 2 - @organization = Organization.find(params[:organization_id]) @containers = [ OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)] + @organization = Organization.find(@containers.first.organization_id) show_attachments @containers render :layout => 'base_org' # @subfield = params[:org_subfield_id] @@ -733,4 +733,8 @@ class FilesController < ApplicationController # format.html end end + + def subfield_upload_file + @org_subfield = OrgSubfield.find(params[:org_subfield_id]) + end end diff --git a/app/views/files/_upload_subfield_file.html.erb b/app/views/files/_upload_subfield_file.html.erb index c3ca72ecd..5d8723d03 100644 --- a/app/views/files/_upload_subfield_file.html.erb +++ b/app/views/files/_upload_subfield_file.html.erb @@ -10,7 +10,7 @@ - <%= render :partial => 'files/attachement_list',:locals => {:org_subfield => org_subfield} %> + <%= render :partial => 'files/attachement_list'%>
<%= l(:button_cancel)%> <%= l(:button_confirm)%> @@ -18,9 +18,7 @@ - <% content_for :header_tags do %> - <%= javascript_include_tag 'attachments' %> - <% end %> +