From d99910e8a100f0237536c36ab95e6f3c1774688a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 10 Apr 2015 16:34:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=95=99=E8=A8=80=E5=8A=A8=E6=80=81url=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/users_helper.rb | 25 +++++++++++++++++++++++++ app/views/users/show.html.erb | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 58935dd11..af2d5abc4 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -278,4 +278,29 @@ module UsersHelper end } end + + #获取用户留言相关的连接 + def user_jour_feed_back_url active + if active.act_type == "JournalsForMessage" + jour = JournalsForMessage.find active.act_id + if jour + case jour.jour_type + when "Principal" + link_to(l(:label_goto), user_newfeedback_user_path(jour.jour_id)) + when "Project" + link_to(l(:label_goto), project_feedback_path(jour.jour_id)) + when "Bid" + link_to(l(:label_goto), course_for_bid_path(jour.jour_id)) + when "Course" + link_to(l(:label_goto), course_feedback_path(jour.jour_id)) + when "Contest" + link_to(l(:label_goto), show_contest_contest_path(jour.jour_id)) + when "Softapplication" + link_to(l(:label_goto), softapplication_path(jour.jour_id)) + when "HomeworkAttach" + link_to(l(:label_goto), course_for_bid_path(jour.jour_id)) + end + end + end + end end diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 9b0d3651e..d4c0d4379 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -103,7 +103,8 @@

- <%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %> + <% puts 11111111111111%> + <%= user_jour_feed_back_url e %>