修改bug《选定了内容类型后再点击表头进行排序总是返回一个空白页》

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2014-10-28 23:48:58 +08:00
parent 2bd08d1aaa
commit a6698bf2f1
1 changed files with 18 additions and 14 deletions

View File

@ -16,7 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class FilesController < ApplicationController class FilesController < ApplicationController
layout 'base_projects'#by young if @project
layout 'base_projects' #by young
else
layout 'base_courses'
end
menu_item :files menu_item :files
before_filter :find_project_by_project_id#, :except => [:getattachtype] before_filter :find_project_by_project_id#, :except => [:getattachtype]
@ -300,25 +304,25 @@ class FilesController < ApplicationController
@containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)] @containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)]
@containers += @project.versions.includes(:attachments).reorder(sort).all @containers += @project.versions.includes(:attachments).reorder(sort).all
show_attachments @containers
@attachtype = params[:type].to_i #render :layout => 'base_projects'
@contenttype = params[:contentType].to_s
render :layout => 'base_projects'
elsif @course elsif @course
@isproject = false @isproject = false
@containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)] @containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)]
show_attachments @containers # show_attachments @containers
@attachtype = params[:type].to_i # @attachtype = params[:type].to_i
@contenttype = params[:contentType].to_s # @contenttype = params[:contentType].to_s
render :layout => 'base_courses'
end end
show_attachments @containers
@attachtype = params[:type].to_i
@contenttype = params[:contentType].to_s
respond_to do |format|
# respond_to do |format| format.js
# format.js format.html
# format.html end
# end
end end
end end