Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

seller creation works

  • Loading branch information...
commit ad8420cc458d7d7e771bb0869f6f80dcf51b200c 1 parent 20c1e35
@kalebwalton authored
View
10 Versionfile
@@ -1,9 +1 @@
-# This file is used to designate compatibilty with different versions of Spree
-# Please see http://spreecommerce.com/documentation/extensions.html#versionfile for details
-
-# Examples
-#
-# "0.50.x" => { :branch => "master" }
-# "0.40.x" => { :tag => "v1.0.0", :version => "1.0.0" }
-
-
+"0.60.1" => { :branch => "master" }
View
14 app/models/user_decorator.rb
@@ -0,0 +1,14 @@
+User.class_eval do
+
+ attr_accessible :role
+
+ def role=(role_name)
+ @role = role_name
+ self.roles << Role.find_by_name(role_name)
+ end
+
+ def role
+ @role
+ end
+
+end
View
1  app/views/shared/_seller_fields.html.erb
@@ -0,0 +1 @@
+<%= hidden_field_tag 'user[role]', params[:user][:role] %>
View
2  config/locales/en.yml
@@ -0,0 +1,2 @@
+ ---
+ en:
View
3  config/routes.rb
@@ -1,3 +1,6 @@
Rails.application.routes.draw do
# Add your extension routes here
+ devise_scope :user do
+ get "/signup/seller" => "user_registrations#new", :as => :signup_seller, :defaults => { :user => {:role => "seller"} }
+ end
end
View
11 db/default/roles.yml
@@ -0,0 +1,11 @@
+admin_role:
+ id: 1
+ name: admin
+
+user_role:
+ id: 2
+ name: user
+
+seller_role:
+ id: 3
+ name: seller
View
2  lib/spree_seller_hooks.rb
@@ -1,3 +1,3 @@
class SpreeSellerHooks < Spree::ThemeSupport::HookListener
- # custom hooks go here
+ # insert_after :signup_below_password_fields, 'shared/seller_fields'
end
Please sign in to comment.
Something went wrong with that request. Please try again.