Skip to content
Browse files

highlight category

  • Loading branch information...
1 parent 770ef48 commit e6621778efed9c133fd30b72751d057dd46e4bb8 Jia Brown committed Mar 17, 2012
Showing with 19 additions and 10 deletions.
  1. +19 −10 app/decorators/discussion_list_decorator.rb
View
29 app/decorators/discussion_list_decorator.rb
@@ -30,21 +30,30 @@ def matched_discussions
private
- def conversations_link
- link_params = h.params.merge(:category => "conversations")
-
- h.link_to "Conversations", h.course_discussions_path(link_params)
+ def conversations_link
+ if h.params[:category] == "conversations" || h.params[:category].blank?
+ "Conversations"
+ else
+ link_params = h.params.merge(:category => "conversations")
+ h.link_to "Conversations", h.course_discussions_path(link_params)
+ end
end
def reviews_link
- link_params = h.params.merge(:category => "reviews")
-
- h.link_to "Reviews", h.course_discussions_path(link_params)
+ if h.params[:category] == "reviews"
+ "Reviews"
+ else
+ link_params = h.params.merge(:category => "reviews")
+ h.link_to "Reviews", h.course_discussions_path(link_params)
+ end
end
def evaluations_link
- link_params = h.params.merge(:category => "evaluations")
-
- h.link_to "Evaluations", h.course_discussions_path(link_params)
+ if h.params[:category] == "evaluations"
+ "Evaluations"
+ else
+ link_params = h.params.merge(:category => "evaluations")
+ h.link_to "Evaluations", h.course_discussions_path(link_params)
+ end
end
end

0 comments on commit e662177

Please sign in to comment.
Something went wrong with that request. Please try again.