ad_man 0.0.5 → 0.0.6
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.
- data/README.md +103 -0
- data/app/assets/javascripts/ad_man/advertisements.js +8 -0
- data/app/controllers/ad_man/advertisements_controller.rb +9 -1
- data/app/helpers/ad_man/application_helper.rb +29 -16
- data/app/models/ad_man/advertisement.rb +44 -41
- data/app/views/ad_man/advertisements/get_ad.js.erb +2 -0
- data/app/views/ad_man/advertisements/show.html.erb +2 -2
- data/app/views/ad_man/keywords/show.html.erb +1 -1
- data/config/routes.rb +7 -2
- data/lib/ad_man/version.rb +1 -1
- data/lib/ad_man.rb +5 -5
- data/lib/generators/ad_man/install_generator.rb +14 -16
- data/lib/generators/ad_man/templates/advertisements_controller.rb +4 -0
- data/lib/generators/ad_man/templates/keywords_controller.rb +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +9 -4
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +278 -35896
- data/test/fixtures/ad_man/keywords.yml +3 -0
- data/test/functional/ad_man/advertisements_controller_test.rb +33 -14
- data/test/functional/ad_man/keywords_controller_test.rb +13 -14
- data/test/test_helper.rb +8 -4
- data/test/unit/ad_man/keyword_test.rb +1 -1
- metadata +7 -44
- data/README.rdoc +0 -61
- data/test/dummy/log/test.log +0 -1406
- data/test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/banner/test.jpeg +0 -0
- data/test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/leaderboard/test.jpeg +0 -0
- data/test/dummy/tmp/cache/assets/C02/0A0/sprockets%2F625bdc26802f8c498265353870490587 +0 -0
- data/test/dummy/tmp/cache/assets/CC8/220/sprockets%2F234102a39a522cfab9195fd0d7c12640 +0 -0
- data/test/dummy/tmp/cache/assets/CD6/A60/sprockets%2Fcca4c63026454615fd0a54b65b881d64 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CE4/9E0/sprockets%2F3f5956491fde7227a651e20e4d756b1a +0 -0
- data/test/dummy/tmp/cache/assets/D31/910/sprockets%2Fc1c18d3d756fe2777d18b236a0aea400 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D3A/220/sprockets%2Fce53c5b352a83645d36d96aff26020fb +0 -0
- data/test/dummy/tmp/cache/assets/D3E/AF0/sprockets%2F317881d54abbd5721deee7d204e70e66 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D79/2D0/sprockets%2F0d684f7bbe7d675f000dff8821d90ae8 +0 -0
- data/test/dummy/tmp/cache/assets/DBA/3C0/sprockets%2F9ca84f8118d29c3fd7bfd2876f83dc7e +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/DF7/090/sprockets%2Fb3b1a32b0f923d6741fd5dacdf9f59ab +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E56/460/sprockets%2F5dde4d3dd93c8afa78eb0ba3fb55c20c +0 -0
@@ -2,53 +2,72 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module AdMan
|
4
4
|
class AdvertisementsControllerTest < ActionController::TestCase
|
5
|
+
|
5
6
|
setup do
|
6
|
-
@advertisement =
|
7
|
+
@advertisement = ad_man_advertisements(:rubyonrails)
|
8
|
+
@routes = AdMan::Engine.routes
|
7
9
|
end
|
8
|
-
|
10
|
+
|
9
11
|
test "should get index" do
|
10
12
|
get :index
|
11
13
|
assert_response :success
|
12
14
|
assert_not_nil assigns(:advertisements)
|
13
15
|
assert_not_nil assigns(:keywords)
|
14
16
|
end
|
15
|
-
|
17
|
+
|
16
18
|
test "should get new" do
|
17
19
|
get :new
|
18
20
|
assert_response :success
|
19
21
|
end
|
20
|
-
|
22
|
+
|
21
23
|
test "should create advertisement" do
|
22
24
|
assert_difference('Advertisement.count') do
|
23
|
-
post :create, advertisement: {
|
24
|
-
|
25
|
-
|
25
|
+
post :create, advertisement: {
|
26
|
+
destination_url: "http://stackoverflow.com/",
|
27
|
+
title: "UniqueTitle",
|
28
|
+
ad_banner: fixture_file_upload("/test.jpeg","image/jpeg"),
|
29
|
+
display_count: 0,
|
30
|
+
click_count: 0,
|
31
|
+
priority: 1
|
32
|
+
}, keyword_id: 1
|
26
33
|
end
|
27
|
-
|
34
|
+
|
28
35
|
assert_redirected_to advertisement_path(assigns(:advertisement))
|
29
36
|
end
|
30
|
-
|
37
|
+
|
31
38
|
test "should show advertisement" do
|
32
39
|
get :show, id: @advertisement
|
33
40
|
assert_response :success
|
34
41
|
end
|
35
|
-
|
42
|
+
|
36
43
|
test "should get edit" do
|
37
44
|
get :edit, id: @advertisement
|
38
45
|
assert_response :success
|
39
46
|
end
|
40
|
-
|
47
|
+
|
41
48
|
test "should update advertisement" do
|
42
|
-
put :update, id: @advertisement, advertisement: {
|
49
|
+
put :update, id: @advertisement, advertisement: {
|
50
|
+
destination_url: "http://stackoverflow.com/",
|
51
|
+
title: "UniqueTitle",
|
52
|
+
ad_banner: fixture_file_upload("/test.jpeg","image/jpeg"),
|
53
|
+
display_count: 0,
|
54
|
+
click_count: 0,
|
55
|
+
priority: 1
|
56
|
+
}, keyword_id: 1
|
43
57
|
assert_redirected_to advertisement_path(assigns(:advertisement))
|
44
58
|
end
|
45
|
-
|
59
|
+
|
46
60
|
test "should destroy advertisement" do
|
47
61
|
assert_difference('Advertisement.count', -1) do
|
48
62
|
delete :destroy, id: @advertisement
|
49
63
|
end
|
50
|
-
|
64
|
+
|
51
65
|
assert_redirected_to advertisements_path
|
52
66
|
end
|
67
|
+
|
68
|
+
test "should redirect on click through" do
|
69
|
+
get :click_through, id: @advertisement.id
|
70
|
+
assert_redirected_to @advertisement.destination_url
|
71
|
+
end
|
53
72
|
end
|
54
73
|
end
|
@@ -3,49 +3,48 @@ require 'test_helper'
|
|
3
3
|
module AdMan
|
4
4
|
class KeywordsControllerTest < ActionController::TestCase
|
5
5
|
setup do
|
6
|
-
@keyword =
|
6
|
+
@keyword = ad_man_keywords(:one)
|
7
|
+
@routes = AdMan::Engine.routes
|
7
8
|
end
|
8
|
-
|
9
|
+
|
9
10
|
test "should get index" do
|
10
11
|
get :index
|
11
12
|
assert_response :success
|
12
13
|
assert_not_nil assigns(:keywords)
|
13
14
|
end
|
14
|
-
|
15
|
+
|
15
16
|
test "should get new" do
|
16
17
|
get :new
|
17
18
|
assert_response :success
|
18
19
|
end
|
19
|
-
|
20
|
+
|
20
21
|
test "should create keyword" do
|
21
22
|
assert_difference('Keyword.count') do
|
22
|
-
post :create, keyword: { name:
|
23
|
+
post :create, keyword: { name: 'RandomName' }
|
23
24
|
end
|
24
|
-
|
25
|
-
assert_redirected_to keyword_path(assigns(:keyword))
|
25
|
+
assert_redirected_to advertisements_path
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
test "should show keyword" do
|
29
29
|
get :show, id: @keyword
|
30
30
|
assert_response :success
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
test "should get edit" do
|
34
34
|
get :edit, id: @keyword
|
35
35
|
assert_response :success
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
test "should update keyword" do
|
39
39
|
put :update, id: @keyword, keyword: { name: @keyword.name }
|
40
|
-
assert_redirected_to
|
40
|
+
assert_redirected_to advertisements_path
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
test "should destroy keyword" do
|
44
44
|
assert_difference('Keyword.count', -1) do
|
45
45
|
delete :destroy, id: @keyword
|
46
46
|
end
|
47
|
-
|
48
|
-
assert_redirected_to keywords_path
|
47
|
+
assert_redirected_to advertisements_path
|
49
48
|
end
|
50
49
|
end
|
51
50
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
+
require 'rubygems'
|
1
2
|
# Configure Rails Environment
|
2
3
|
ENV["RAILS_ENV"] = "test"
|
3
|
-
|
4
4
|
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
5
|
require "rails/test_help"
|
6
6
|
|
@@ -9,11 +9,15 @@ Rails.backtrace_cleaner.remove_silencers!
|
|
9
9
|
# Load support files
|
10
10
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
11
11
|
|
12
|
-
# Load fixtures from the engine
|
13
12
|
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
14
13
|
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
15
14
|
end
|
16
15
|
|
17
16
|
def sample_file(filename = "test.jpeg")
|
18
|
-
File.new("test/fixtures/#{filename}")
|
19
|
-
end
|
17
|
+
File.new("#{AdMan::Engine.root}/test/fixtures/#{filename}")
|
18
|
+
end
|
19
|
+
|
20
|
+
class ActiveSupport::TestCase
|
21
|
+
fixtures :all
|
22
|
+
end
|
23
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ad_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-08-
|
13
|
+
date: 2012-08-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- app/models/ad_man/keyword.rb
|
85
85
|
- app/views/ad_man/advertisements/_form.html.erb
|
86
86
|
- app/views/ad_man/advertisements/edit.html.erb
|
87
|
+
- app/views/ad_man/advertisements/get_ad.js.erb
|
87
88
|
- app/views/ad_man/advertisements/index.html.erb
|
88
89
|
- app/views/ad_man/advertisements/new.html.erb
|
89
90
|
- app/views/ad_man/advertisements/show.html.erb
|
@@ -100,10 +101,12 @@ files:
|
|
100
101
|
- lib/ad_man/version.rb
|
101
102
|
- lib/ad_man.rb
|
102
103
|
- lib/generators/ad_man/install_generator.rb
|
104
|
+
- lib/generators/ad_man/templates/advertisements_controller.rb
|
105
|
+
- lib/generators/ad_man/templates/keywords_controller.rb
|
103
106
|
- lib/tasks/ad_man_tasks.rake
|
104
107
|
- MIT-LICENSE
|
105
108
|
- Rakefile
|
106
|
-
- README.
|
109
|
+
- README.md
|
107
110
|
- test/ad_man_test.rb
|
108
111
|
- test/dummy/app/assets/javascripts/application.js
|
109
112
|
- test/dummy/app/assets/stylesheets/application.css
|
@@ -131,13 +134,10 @@ files:
|
|
131
134
|
- test/dummy/db/schema.rb
|
132
135
|
- test/dummy/db/test.sqlite3
|
133
136
|
- test/dummy/log/development.log
|
134
|
-
- test/dummy/log/test.log
|
135
137
|
- test/dummy/public/404.html
|
136
138
|
- test/dummy/public/422.html
|
137
139
|
- test/dummy/public/500.html
|
138
140
|
- test/dummy/public/favicon.ico
|
139
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/banner/test.jpeg
|
140
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/leaderboard/test.jpeg
|
141
141
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/original/FabTable_01.jpg
|
142
142
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/original/test.jpeg
|
143
143
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/small/FabTable_01.jpg
|
@@ -157,23 +157,6 @@ files:
|
|
157
157
|
- test/dummy/Rakefile
|
158
158
|
- test/dummy/README.rdoc
|
159
159
|
- test/dummy/script/rails
|
160
|
-
- test/dummy/tmp/cache/assets/C02/0A0/sprockets%2F625bdc26802f8c498265353870490587
|
161
|
-
- test/dummy/tmp/cache/assets/CC8/220/sprockets%2F234102a39a522cfab9195fd0d7c12640
|
162
|
-
- test/dummy/tmp/cache/assets/CD6/A60/sprockets%2Fcca4c63026454615fd0a54b65b881d64
|
163
|
-
- test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
164
|
-
- test/dummy/tmp/cache/assets/CE4/9E0/sprockets%2F3f5956491fde7227a651e20e4d756b1a
|
165
|
-
- test/dummy/tmp/cache/assets/D31/910/sprockets%2Fc1c18d3d756fe2777d18b236a0aea400
|
166
|
-
- test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
167
|
-
- test/dummy/tmp/cache/assets/D3A/220/sprockets%2Fce53c5b352a83645d36d96aff26020fb
|
168
|
-
- test/dummy/tmp/cache/assets/D3E/AF0/sprockets%2F317881d54abbd5721deee7d204e70e66
|
169
|
-
- test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
|
170
|
-
- test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
|
171
|
-
- test/dummy/tmp/cache/assets/D79/2D0/sprockets%2F0d684f7bbe7d675f000dff8821d90ae8
|
172
|
-
- test/dummy/tmp/cache/assets/DBA/3C0/sprockets%2F9ca84f8118d29c3fd7bfd2876f83dc7e
|
173
|
-
- test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
174
|
-
- test/dummy/tmp/cache/assets/DF7/090/sprockets%2Fb3b1a32b0f923d6741fd5dacdf9f59ab
|
175
|
-
- test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
176
|
-
- test/dummy/tmp/cache/assets/E56/460/sprockets%2F5dde4d3dd93c8afa78eb0ba3fb55c20c
|
177
160
|
- test/fixtures/ad_man/advertisements.yml
|
178
161
|
- test/fixtures/ad_man/keywords.yml
|
179
162
|
- test/fixtures/test.jpeg
|
@@ -186,7 +169,7 @@ files:
|
|
186
169
|
- test/unit/ad_man/keyword_test.rb
|
187
170
|
- test/unit/helpers/ad_man/advertisements_helper_test.rb
|
188
171
|
- test/unit/helpers/ad_man/keywords_helper_test.rb
|
189
|
-
homepage: http://github.com/
|
172
|
+
homepage: http://github.com/kudelabs/ad_man
|
190
173
|
licenses: []
|
191
174
|
post_install_message:
|
192
175
|
rdoc_options: []
|
@@ -238,13 +221,10 @@ test_files:
|
|
238
221
|
- test/dummy/db/schema.rb
|
239
222
|
- test/dummy/db/test.sqlite3
|
240
223
|
- test/dummy/log/development.log
|
241
|
-
- test/dummy/log/test.log
|
242
224
|
- test/dummy/public/404.html
|
243
225
|
- test/dummy/public/422.html
|
244
226
|
- test/dummy/public/500.html
|
245
227
|
- test/dummy/public/favicon.ico
|
246
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/banner/test.jpeg
|
247
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/leaderboard/test.jpeg
|
248
228
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/original/FabTable_01.jpg
|
249
229
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/original/test.jpeg
|
250
230
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/small/FabTable_01.jpg
|
@@ -264,23 +244,6 @@ test_files:
|
|
264
244
|
- test/dummy/Rakefile
|
265
245
|
- test/dummy/README.rdoc
|
266
246
|
- test/dummy/script/rails
|
267
|
-
- test/dummy/tmp/cache/assets/C02/0A0/sprockets%2F625bdc26802f8c498265353870490587
|
268
|
-
- test/dummy/tmp/cache/assets/CC8/220/sprockets%2F234102a39a522cfab9195fd0d7c12640
|
269
|
-
- test/dummy/tmp/cache/assets/CD6/A60/sprockets%2Fcca4c63026454615fd0a54b65b881d64
|
270
|
-
- test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
271
|
-
- test/dummy/tmp/cache/assets/CE4/9E0/sprockets%2F3f5956491fde7227a651e20e4d756b1a
|
272
|
-
- test/dummy/tmp/cache/assets/D31/910/sprockets%2Fc1c18d3d756fe2777d18b236a0aea400
|
273
|
-
- test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
274
|
-
- test/dummy/tmp/cache/assets/D3A/220/sprockets%2Fce53c5b352a83645d36d96aff26020fb
|
275
|
-
- test/dummy/tmp/cache/assets/D3E/AF0/sprockets%2F317881d54abbd5721deee7d204e70e66
|
276
|
-
- test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
|
277
|
-
- test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
|
278
|
-
- test/dummy/tmp/cache/assets/D79/2D0/sprockets%2F0d684f7bbe7d675f000dff8821d90ae8
|
279
|
-
- test/dummy/tmp/cache/assets/DBA/3C0/sprockets%2F9ca84f8118d29c3fd7bfd2876f83dc7e
|
280
|
-
- test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
281
|
-
- test/dummy/tmp/cache/assets/DF7/090/sprockets%2Fb3b1a32b0f923d6741fd5dacdf9f59ab
|
282
|
-
- test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
283
|
-
- test/dummy/tmp/cache/assets/E56/460/sprockets%2F5dde4d3dd93c8afa78eb0ba3fb55c20c
|
284
247
|
- test/fixtures/ad_man/advertisements.yml
|
285
248
|
- test/fixtures/ad_man/keywords.yml
|
286
249
|
- test/fixtures/test.jpeg
|
data/README.rdoc
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
Ad_man
|
2
|
-
Ad_man is an advertising manager mountable engine. It allows the user to upload and manage advertising banners, and provides an easy to use helper for inserting the banners on your website. Also counts the number of times an ad has shown, and the number of times an advertisement has been clicked on. The user must set a keyword for each ad.
|
3
|
-
|
4
|
-
Currently supports two image sizes for advertising: Leaderboard 728 x 90 and Banner 468 x 60. TODO: Will implement 9 different sizes as mentioned by google's adwords requirements.
|
5
|
-
|
6
|
-
Requires Paperclip 3.1, and requires ImageMagick be running on the server.
|
7
|
-
|
8
|
-
Getting started
|
9
|
-
Ad_man works with Rails 3.2 onwards. You can add it to your Gemfile with:
|
10
|
-
|
11
|
-
gem 'ad_man'
|
12
|
-
After you install Ad_man and add it to your Gemfile, you need to run the generator:
|
13
|
-
|
14
|
-
rails generate ad_man:install
|
15
|
-
Install the migrations, and rake the database:
|
16
|
-
|
17
|
-
rake ad_man:install:migrations
|
18
|
-
rake db:migrate
|
19
|
-
See where Ad_man is located by running:
|
20
|
-
|
21
|
-
rake routes
|
22
|
-
In our case, we needed to move the line generated by the install in the routes file to our admin space. Then add any before_filters to the controllers that were generated.
|
23
|
-
|
24
|
-
Make sure to change references to the application using the main_app helper:
|
25
|
-
|
26
|
-
<%= link_to "Home", main_app.root_path %>
|
27
|
-
<%= link_to "Advertising", main_app.ad_man_path %>
|
28
|
-
One final change may be necessary in order to preview an image before saving, and that is to add this line to the admin view:
|
29
|
-
|
30
|
-
<%= javascript_include_tag "ad_man/advertisements.js" %>
|
31
|
-
Changing default values
|
32
|
-
If you need to change the default values set by ad_man, you will need to create an ad_man.rb initializer in your config/initializers folder.
|
33
|
-
|
34
|
-
# AdMan Default Values
|
35
|
-
AdMan.leaderboard_size = "728x90"
|
36
|
-
AdMan.banner_size = "468x60"
|
37
|
-
AdMan.max_image_size = 50 # 50Kb maximum image size
|
38
|
-
|
39
|
-
# These are configurable dimensions (currently leaderboard default)
|
40
|
-
AdMan.image_dimensions_width = 728
|
41
|
-
AdMan.image_dimensions_height = 90
|
42
|
-
|
43
|
-
# Configurable content type for advertising
|
44
|
-
AdMan.content_type = ["image/jpg", "image/bmp", "image/png", "image/gif", "image/jpeg"]
|
45
|
-
|
46
|
-
# Configurable max advertising for keyword
|
47
|
-
AdMan.max_count = 6
|
48
|
-
Putting an advertisement in the view
|
49
|
-
To put your advertisement in the view just add:
|
50
|
-
|
51
|
-
<%= link_to_ad %>
|
52
|
-
To call advertisements by keyword:
|
53
|
-
|
54
|
-
<%= link_to_ad @keyword.name %>
|
55
|
-
Authors
|
56
|
-
Written by David Strand and Tyler Hu
|
57
|
-
|
58
|
-
Copyright & Licensing
|
59
|
-
Copyright (c) 2012 Kudelabs, Kudelabs on Github
|
60
|
-
|
61
|
-
Released under MIT License.
|