blob: a4f081a65b6c03598f7337c8bf4bb0a6d34a4d31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
module Admin
class ProductsController < AdminController
attr_reader :product_api
def initialize(product_api = Spank::IOC.resolve(:product_api))
@product_api = product_api
super()
end
def index
@products = @product_api.search(params[:q])
end
def show
@product = product_api.find(params[:id])
@tool = Tool.find_by(:asin=>params[:id])
end
def create
Tool.create(:name=>params[:name],:asin=>params[:asin])
redirect_to admin_product_path(params[:asin])
end
end
end
|