drhenner/ror_ecommerce

View on GitHub
app/controllers/wish_items_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class WishItemsController < ApplicationController
  before_action :require_user

  def index
  end

  # DELETE /wish_items/1
  def destroy
    if params[:variant_id].present?
      item = current_user.wish_list_items.find_by(variant_id: params[:variant_id])
      item.update_attributes( active: false )
    end
    render  action: :index
  end
end