caboose-cms 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/controllers/caboose/products_controller.rb +9 -3
- data/config/routes.rb +6 -2
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjZlMTNjZTdjYTgyNDgwNjAzNDcyM2I0MWRjODJjOThhYjY0NmY1Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTBiMjA0NDM1NDEyYjIzMmFjMTI5NzVjNWEyN2VmZWRmZDU3NDMzYQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGVmNjgzZTI2MjE2NGI2NTg0NGQ1ZWM1ZjhiOGQyZmI2ODY3OGQ0MGIzYTk2
|
10
|
+
ODQ3YjVmZjg1NjkyNmI3YjE0MjE3OTY2ZjRkZmEwNzMxNTVhMTA3ZDljNGU1
|
11
|
+
ZWUzZTg5YzE5ZmE4MTNjNDJiYTAwNzdhNjRmYWZiNWYwZDNlOTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2M5ODVjMjdhYTY0M2U0N2EyNWM0MzhjMzgxY2I3MTM5OTIyMDNmODI4YmVm
|
14
|
+
ZDBmMmY2N2MwMWU4ZjUyNDg0OWEyNzU4YTQwODEzZTJkMmNkNTE3YWMwNWIw
|
15
|
+
Yzc3MmIxYzdiNjNiOWU1NGI2YzZjNDZhM2VjNDg2OTFjZTM2NTI=
|
@@ -106,19 +106,25 @@ module Caboose
|
|
106
106
|
}
|
107
107
|
end
|
108
108
|
|
109
|
+
#=============================================================================
|
110
|
+
# API actions
|
111
|
+
#=============================================================================
|
112
|
+
|
109
113
|
# GET /api/products
|
110
|
-
def
|
114
|
+
def api_index
|
111
115
|
render :json => Product.where(:status => 'Active')
|
112
116
|
end
|
113
117
|
|
114
118
|
# GET /api/products/:id
|
115
119
|
def api_details
|
116
|
-
|
120
|
+
p = Product.where(:id => params[:id]).first
|
121
|
+
render :json => p ? p : { :error => 'Invalid product ID' }
|
117
122
|
end
|
118
123
|
|
119
124
|
# GET /api/products/:id/variants
|
120
125
|
def api_variants
|
121
|
-
|
126
|
+
p = Product.where(:id => params[:id]).first
|
127
|
+
render :json => p ? p.variants : { :error => 'Invalid product ID' }
|
122
128
|
end
|
123
129
|
|
124
130
|
#=============================================================================
|
data/config/routes.rb
CHANGED
@@ -372,8 +372,12 @@ Caboose::Engine.routes.draw do
|
|
372
372
|
delete "/admin/orders/:id" => "orders#admin_delete"
|
373
373
|
|
374
374
|
# API
|
375
|
-
get "
|
376
|
-
get "
|
375
|
+
get "/api/products" => "products#api_index"
|
376
|
+
get "/api/products/:id" => "products#api_details"
|
377
|
+
get "/api/products/:id/variants" => "products#api_variants"
|
378
|
+
|
379
|
+
get "caboose/block-types" => "block_types#api_block_type_list"
|
380
|
+
get "caboose/block-types/:name" => "block_types#api_block_type"
|
377
381
|
|
378
382
|
match '*path' => 'pages#show'
|
379
383
|
root :to => 'pages#show'
|
data/lib/caboose/version.rb
CHANGED