Class: Spree::WishlistsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/wishlists_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



32
33
34
35
36
37
38
# File 'app/controllers/spree/wishlists_controller.rb', line 32

def create
  @wishlist = Spree::Wishlist.new(params[:wishlist])
  @wishlist.user = current_user

  @wishlist.save
  respond_with(@wishlist)
end

#destroyObject



40
41
42
43
44
45
46
# File 'app/controllers/spree/wishlists_controller.rb', line 40

def destroy
  @wishlist = Spree::Wishlist.find_by_access_hash(params[:id])
  @wishlist.destroy
  respond_with(@wishlist )do |format|
    format.html { redirect_to  }
  end
end

#editObject



13
14
15
16
17
# File 'app/controllers/spree/wishlists_controller.rb', line 13

def edit
  @wishlist = Spree::Wishlist.find_by_access_hash(params[:id])

  respond_with(@wishlist)
end

#newObject



7
8
9
10
11
# File 'app/controllers/spree/wishlists_controller.rb', line 7

def new
  @wishlist = Spree::Wishlist.new

  respond_with(@wishlist)
end

#showObject



26
27
28
29
30
# File 'app/controllers/spree/wishlists_controller.rb', line 26

def show
  @wishlist = Spree::Wishlist.find_by_access_hash(params[:id])

  respond_with(@wishlist)
end

#updateObject



19
20
21
22
23
24
# File 'app/controllers/spree/wishlists_controller.rb', line 19

def update
  @wishlist = Spree::Wishlist.find_by_access_hash(params[:id])
  @wishlist.update_attributes(params[:wishlist])

  respond_with(@wishlist)
end