Using a specific template, I have listed topics in the following way:
//Template used for topic list display
%li.topic{:topic_slug => "<%=topic.slug%>", :topic_name =>"<%=topic.text%>"}
%a{href: "#!/topics/<%=topic.slug%>" }
<%= topic.text %>
This list is displayed on a web application.
Now, my goal is to be able to choose a topic and apply a highlight to it. How can this be achieved? I currently use jQuery to select the element like so:
addAllTopics: ->
@options.topics.each(@addOneTopic)
$(@el).find(".topics li[topic_slug=#{@options.topic}]")
However, I am uncertain about how to implement the highlighting on the selected element. Does anyone have any suggestions or advice on this matter?