Sha256: 4d5ffb901b271e5ce9e4e2dc52e61231a04287f8add29a4f9102fa6c37c15469
Contents?: true
Size: 1 KB
Versions: 2
Compression:
Stored size: 1 KB
Contents
module Workarea decorate Admin::CatalogProductsController, with: :design_toscano do decorated do # Place code to decorate here that would normally go on the class # level, e.g.: # # field :name, type: String end class_methods do # Place methods to define on the class level here. These methods # will be available by calling Admin::CatalogProductsController.your_method. Do # not prefix these methods with `self.` end def update set_additional_details super end def set_additional_details @product.additional_details = HashUpdate.new( original: @product.additional_details, adds: params[:new_additional_details], updates: params[:additional_details], removes: params[:additional_details_to_remove] ).result_grouped end # Instance methods can go right in the main definition of the # decorator, as it is a module that gets prepended into the class of # your choice. end end
Version data entries
2 entries across 2 versions & 1 rubygems