Sha256: 635a6e833968e0bd692652171eb0d7b192748713972c28794a0abdd5653a63d9
Contents?: true
Size: 678 Bytes
Versions: 6
Compression:
Stored size: 678 Bytes
Contents
module Spree module Admin class AttachmentsController < ResourceController protect_from_forgery before_action :load_data create.before :set_viewable update.before :set_viewable private def load_data @product = Spree::Product.friendly.find(params[:product_id]) end def location_after_destroy admin_product_attachments_url(@product) end def location_after_save admin_product_attachments_url(@product) end def set_viewable @attachment.viewable_type = 'Spree::Variant' @attachment.viewable_id = params[:attachment][:viewable_id] end end end end
Version data entries
6 entries across 6 versions & 1 rubygems