class Spree::DevicesController < Spree::BaseController before_action :set_user def index @user_devices = @user.user_devices end def destroy device_service.destroy_user_device(@user, params[:id]) redirect_to devices_path end private def set_user @user = spree_current_user end def device_service Spree::DeviceService.instance end end