From f3d8aebfe4edc0344fe6a5e6d0204ed6347e7f4f Mon Sep 17 00:00:00 2001 From: gonglexin <18008490802@163.com> Date: Thu, 30 Oct 2014 20:32:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E6=8E=92=E5=BA=8F=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E7=9A=84=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 13 ++++++++++++- app/views/homework_attach/_homeworks_list.html.erb | 10 +++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 799316c47..be197a7da 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1892,5 +1892,16 @@ module ApplicationHelper content_tag(:ul, logos.join("").html_safe, :class => ul_class.to_s).html_safe end - + def sort_homework_path(bid, sort) + case self.action_name + when 'get_not_batch_homework', 'show_courseEx' + get_not_batch_homework_homework_attach_path(bid, sort: sort) + when 'get_batch_homeworks' + get_batch_homeworks_homework_attach_path(bid, sort: sort) + when 'get_homeworks' + get_homeworks_homework_attach_path(bid, sort: sort) + else + '#' + end + end end diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb index f28caa08b..28fa1b6aa 100644 --- a/app/views/homework_attach/_homeworks_list.html.erb +++ b/app/views/homework_attach/_homeworks_list.html.erb @@ -7,14 +7,10 @@ ) 按  - - <%= l(:label_work_rating)%> - + <%= link_to l(:label_work_rating), sort_homework_path(@bid, 'socre'), {:remote => true}%>  /  - - <%= l(:label_time) %> - -  <%= l(:label_sort) %> + <%= link_to l(:label_time), sort_homework_path(@bid, 'time'), {:remote => true}%> +  <%= l(:label_sort) %>