Class: Spree::WishlistsController
- Inherits:
-
BaseController
- Object
- BaseController
- Spree::WishlistsController
- Defined in:
- app/controllers/spree/wishlists_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 account_path } end end |
#edit ⇒ Object
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 |
#new ⇒ Object
7 8 9 10 11 |
# File 'app/controllers/spree/wishlists_controller.rb', line 7 def new @wishlist = Spree::Wishlist.new respond_with(@wishlist) end |
#show ⇒ Object
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 |
#update ⇒ Object
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 |