merb-search 0.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/app/controllers/search.rb +16 -14
- data/app/helpers/search_helper.rb +3 -0
- metadata +4 -2
data/Rakefile
CHANGED
data/app/controllers/search.rb
CHANGED
@@ -2,22 +2,24 @@ class MerbSearch::Search < MerbSearch::Application
|
|
2
2
|
|
3
3
|
def index
|
4
4
|
|
5
|
-
query = params[:q]
|
5
|
+
if @query = params[:q] and !@query.blank?
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
7
|
+
images = boss.images.new(@query, :count => 3)
|
8
|
+
@images = images.resultset unless images.count == 0
|
9
|
+
|
10
|
+
news = boss.news.new(@query, :age => '1d', :count => 3)
|
11
|
+
@news = news.resultset unless news.count == 0
|
12
|
+
|
13
|
+
spelling = boss.spelling.new(@query)
|
14
|
+
@spelling = spelling.resultset unless spelling.count == 0
|
15
|
+
|
16
|
+
web_count = 12 - (images.count + news.count)
|
17
|
+
web = boss.web.new(@query, :count => web_count)
|
18
|
+
@web = web.resultset unless web.count == 0
|
19
|
+
|
20
|
+
end
|
19
21
|
|
20
|
-
|
22
|
+
render
|
21
23
|
|
22
24
|
end
|
23
25
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merb-search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UiPoet
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-12-
|
12
|
+
date: 2008-12-22 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -54,6 +54,8 @@ files:
|
|
54
54
|
- app/controllers
|
55
55
|
- app/controllers/application.rb
|
56
56
|
- app/controllers/search.rb
|
57
|
+
- app/helpers
|
58
|
+
- app/helpers/search_helper.rb
|
57
59
|
- app/views
|
58
60
|
- app/views/search
|
59
61
|
- app/views/search/_article.html.erb
|