Sha256: 0cb31b9bdfb8d5be3f7ea84ba1ddaa892675d6fec3f56a255e7aed543715357e
Contents?: true
Size: 1009 Bytes
Versions: 62
Compression:
Stored size: 1009 Bytes
Contents
module Workarea module Admin class CategorizationsController < Admin::ApplicationController required_permissions :catalog before_action :check_publishing_authorization before_action :find_product def index end def create Catalog::Category.in(id: params[:category_ids]).each do |category| category.add_product(@product.id) end flash[:success] = t('workarea.admin.categorizations.flash_messages.added') redirect_to catalog_product_categorizations_path(@product) end def destroy category = Catalog::Category.find_by(slug: params[:id]) category.remove_product(@product.id) flash[:success] = t('workarea.admin.categorizations.flash_messages.removed') head :ok end private def find_product model = Catalog::Product.find_by(slug: params[:catalog_product_id]) @product = ProductViewModel.new(model, view_model_options) end end end end
Version data entries
62 entries across 62 versions & 1 rubygems