Base progress

This commit is contained in:
2015-09-16 11:50:55 +02:00
parent ef894f9e02
commit 6a085b1ca2
52 changed files with 3686 additions and 1818 deletions
@@ -1,6 +1,7 @@
module Suppliers
class SuppliersController < Suppliers::ApplicationController
def index
render json: {}
end
@@ -15,7 +16,7 @@ module Suppliers
#product_categories.products
#product_categories.products.product_variants
#]) #.new(current_supplier).as_json
render json: JSONAPI::Serializer.serialize(current_supplier, serializer: Suppliers::SupplierSerializer, include: %w[
render json: current_supplier, include: %w[
sections
sections.tables
sections.section_areas
@@ -23,13 +24,13 @@ module Suppliers
product_categories
product_categories.products
product_categories.products.product_variants
])
]
end
def update
@supplier = current_supplier
current_supplier.update_attributes(supplier_params)
render json: JSONAPI::Serializer.serialize( current_supplier, serializer: Suppliers::SupplierSerializer)
render json: current_supplier
end
def switch_to