summaryrefslogtreecommitdiff
path: root/app/controllers/admin
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-10-13 11:53:12 -0600
committermo khan <mo@mokhan.ca>2014-10-13 11:53:12 -0600
commitc757fbe694519ae1a1ae7b945bd3e1e095231350 (patch)
treed5ea9ce80b8930a6ace309c1d2508dd1e199fe8b /app/controllers/admin
parent5b1a2483bbaa8cfba1c8373b90789f546773cb58 (diff)
register amazon api in container.
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/tools_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/admin/tools_controller.rb b/app/controllers/admin/tools_controller.rb
index fba8ec2d..2e7c375d 100644
--- a/app/controllers/admin/tools_controller.rb
+++ b/app/controllers/admin/tools_controller.rb
@@ -1,7 +1,12 @@
module Admin
class ToolsController < AdminController
+ def initialize(product_api = Spank::IOC.resolve(:product_api))
+ @product_api = product_api
+ super()
+ end
+
def index
- @tools = AmazonAPI.new.search(params[:q])
+ @tools = @product_api.search(params[:q])
end
end
end