Permalink
Browse files

works with 1.1.0.rc1, added index of wishlists

  • Loading branch information...
1 parent a6f47f6 commit ebe8040dbec705c7cc8174ade419bc831eb8dc85 @gudata committed Apr 21, 2012
View
@@ -2,3 +2,4 @@ spec/dummy
spec/test_app
Gemfile.lock
*.swp
+/nbproject/private/
@@ -10,6 +10,12 @@ def new
respond_with(@wishlist)
end
+ def index
+ @wishlists = current_user.wishlists
+
+ respond_with(@wishlist)
+ end
+
def edit
@wishlist = Spree::Wishlist.find_by_access_hash(params[:id])
@@ -1,4 +1,6 @@
class Spree::WishedProduct < ActiveRecord::Base
belongs_to :variant
belongs_to :wishlist
+
+ attr_accessible :wishlist_id, :variant_id
end
@@ -3,6 +3,8 @@ class Spree::Wishlist < ActiveRecord::Base
has_many :wished_products
before_create :set_access_hash
+ attr_accessible :name, :is_default, :is_private
+
validates :name, :presence => true
def include?(variant_id)
@@ -0,0 +1,6 @@
+<h1 class="row"><%= t(:wishlists) %></h1>
+<%= content_tag :ul do %>
+ <% @wishlists.each do |wishlist| %>
+ <%= content_tag :li, link_to(wishlist.name, wishlist) %>
+ <% end %>
+<% end %>
View
@@ -1,4 +1,4 @@
-Spree::Core::Engine.routes.append do
+Spree::Core::Engine.routes.draw do
resources :wishlists
resources :wished_products, :only => [:create, :update, :destroy]
match '/wishlist' => "wishlists#show", :as => "default_wishlist"
View
@@ -16,8 +16,8 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ["lib"]
- s.add_dependency 'spree_core', '>= 1.0.0'
- s.add_dependency 'spree_auth', '>= 1.0.0'
+ s.add_dependency 'spree_core', '>= 1.1.0.rc1'
+ s.add_dependency 'spree_auth', '>= 1.1.0.rc1'
s.add_development_dependency 'factory_girl', '2.6.4'
s.add_development_dependency 'rspec-rails', '~> 2.9.0'

0 comments on commit ebe8040

Please sign in to comment.