rostra 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -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