Sha256: 01e0ea8841020283759e93e6cf3e2b0e450dd3e5db1ae055979290f00ba94f3e

Contents?: true

Size: 576 Bytes

Versions: 6

Compression:

Stored size: 576 Bytes

Contents

module Comee
  module Core
    class ProductsController < ApplicationController
      include Common

      def index
        super do
          products = Product.leafs
          products.then(&paginate)
        end
      end

      def show
        super do
          product = Comee::Core::Product.with_attached_images.find(params[:id])
          product
        end
      end

      private

      def model_params
        params.required(:payload).permit(:code, :name, :description, :parent_id, :thumbnail_image, :preferred_units, images: [])
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
comee_core-0.1.51 app/controllers/comee/core/products_controller.rb
comee_core-0.1.50 app/controllers/comee/core/products_controller.rb
comee_core-0.1.49 app/controllers/comee/core/products_controller.rb
comee_core-0.1.48 app/controllers/comee/core/products_controller.rb
comee_core-0.1.47 app/controllers/comee/core/products_controller.rb
comee_core-0.1.46 app/controllers/comee/core/products_controller.rb