Sha256: 2b53514fa5b84e6364639b900230ed65c07ac01667ca3afd3c4e2aea22088c01
Contents?: true
Size: 1.25 KB
Versions: 69
Compression:
Stored size: 1.25 KB
Contents
module Comee module Core class ProductsController < ApplicationController include Common def index super do Product.leafs end end def show super do Comee::Core::Product.with_attached_images.find(params[:id]) end end def master_prices data = MasterPrice.includes(:product_lookup, :supplier, :product) .where(product_id: price_params[:product_ids]) render_content(data) end def client_prices data = ClientPrice.where(product_id: price_params[:product_ids]) render_content(data) end def categories root = Product.find_by(code: "root") render_content(root.children) end def filter data = Product.ransack(params[:q]).result render_content(data) end private def model_params params.required(:payload).permit(:code, :name, :description, :parent_id, :thumbnail_image, :preferred_units, :source_id, :weight, :weight_unit_id, :dimensions, :hs_code, :hs_description, images: []) end def price_params params.require(:payload).permit(product_ids: []) end end end end
Version data entries
69 entries across 69 versions & 1 rubygems