mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Adding serializers also
This commit is contained in:
6
app/serializers/spree/image_serializer.rb
Normal file
6
app/serializers/spree/image_serializer.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
module Spree
|
||||
|
||||
class ImageSerializer < ActiveModel::Serializer
|
||||
attributes :id, :mini_url, :alt
|
||||
end
|
||||
end
|
||||
@@ -1,6 +1,6 @@
|
||||
module Spree
|
||||
class VariantSerializer < ActiveModel::Serializer
|
||||
attributes :id, :is_master, :count_on_hand
|
||||
attributes :id, :is_master, :count_on_hand, :options_text
|
||||
has_many :images
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
%products{"ng-controller" => "ProductsCtrl"}
|
||||
%table
|
||||
%thead
|
||||
%th Item
|
||||
%th{colspan: 2} Item
|
||||
%th Description
|
||||
%th Variant
|
||||
%th QTY
|
||||
%th Bulk
|
||||
%th Price
|
||||
%tr.product{"ng-repeat" => "product in data.products "}
|
||||
%td {{ product.name }}
|
||||
%td
|
||||
%img{src: "{{ product.master.images[0].mini_url }}", alt: "{{product.master.images[0].alt}}"}
|
||||
%td
|
||||
{{ product.name }}
|
||||
%td {{ product.description }}
|
||||
%td {{ product.master.id }}
|
||||
%td Quantity thing
|
||||
@@ -18,5 +21,4 @@
|
||||
%small from
|
||||
$ {{ product.price }}
|
||||
|
||||
|
||||
%pre {{ data.products | json }}
|
||||
|
||||
Reference in New Issue
Block a user