diff options
| author | mo khan <mo@mokhan.ca> | 2014-10-13 11:44:34 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-10-13 11:44:34 -0600 |
| commit | dd53c55a98cbb965fd5947e288e5e10f96843101 (patch) | |
| tree | 51815a74f8dd9ab5f867c01b10440e1b3a56ad9b /app/controllers/admin | |
| parent | a8f0c11dd54ca68c3059bc908e61da3b9a83fe74 (diff) | |
add tools page to admin section to search the Amazon Product API.
Diffstat (limited to 'app/controllers/admin')
| -rw-r--r-- | app/controllers/admin/tools_controller.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/admin/tools_controller.rb b/app/controllers/admin/tools_controller.rb new file mode 100644 index 00000000..0bae31ad --- /dev/null +++ b/app/controllers/admin/tools_controller.rb @@ -0,0 +1,15 @@ +module Admin + class ToolsController < AdminController + def index + @tools = search_for_tools(params[:q]) + end + + private + + def search_for_tools(query) + return [] if query.blank? + client = ASIN::Client.instance + client.search(Keywords: query, SearchIndex: :Kitchen, Sort: :salesrank) + end + end +end |
