rostra 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -12,8 +12,11 @@ module Rostra
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def index
|
15
|
-
|
16
|
-
|
15
|
+
if params[:tag_search]
|
16
|
+
@questions = Question.tagged_with(params[:tag_search]).order('created_at desc')
|
17
|
+
else
|
18
|
+
@questions = Question.order('created_at desc')
|
19
|
+
end
|
17
20
|
end
|
18
21
|
|
19
22
|
def show
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Rostra
|
2
2
|
module ApplicationHelper
|
3
3
|
|
4
|
-
# Creates a list of tags linking to
|
4
|
+
# Creates a list of tags linking to the index showing only questions with that tag
|
5
5
|
#
|
6
6
|
def tag_list(question)
|
7
|
-
content_tag :div, "Tags: #{question.tags.map { |tag| link_to tag,
|
7
|
+
content_tag :div, "Tags: #{question.tags.map { |tag| link_to tag, questions_path(:tag_search => "#{tag}")}.join}".html_safe, class: 'tags'
|
8
8
|
end
|
9
9
|
|
10
10
|
# Finds the url to the user's avatar following this logic:
|
data/lib/rostra/version.rb
CHANGED