Class: Spree::UserRegistrationsController

Inherits:
Devise::RegistrationsController
  • Object
show all
Includes:
Core::ControllerHelpers::Auth, Core::ControllerHelpers::Common, Core::ControllerHelpers::Order, Core::ControllerHelpers::Store, SpreeI18n::ControllerLocaleHelper
Defined in:
app/controllers/spree/user_registrations_controller.rb

Instance Method Summary collapse

Instance Method Details

#cancelObject

GET /resource/cancel Forces the session data which is usually expired after sign in to be expired now. This is useful if the user wants to cancel oauth signing in/up in the middle of the process, removing all OAuth session data.



64
65
66
# File 'app/controllers/spree/user_registrations_controller.rb', line 64

def cancel
  super
end

#create {|resource| ... } ⇒ Object

POST /resource/sign_up

Yields:

  • (resource)


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'app/controllers/spree/user_registrations_controller.rb', line 23

def create
  @user = build_resource(spree_user_params)
  resource_saved = resource.save
  yield resource if block_given?
  if resource_saved
    if resource.active_for_authentication?
      set_flash_message :notice, :signed_up
      (resource_name, resource)
      session[:spree_user_signup] = true
      respond_with resource, location: (resource)
    else
      set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}"
      expire_data_after_sign_in!
      respond_with resource, location: (resource)
    end
  else
    clean_up_passwords(resource)
    render :new
  end
end

#destroyObject

DELETE /resource



55
56
57
# File 'app/controllers/spree/user_registrations_controller.rb', line 55

def destroy
  super
end

#editObject

GET /resource/edit



45
46
47
# File 'app/controllers/spree/user_registrations_controller.rb', line 45

def edit
  super
end

#newObject

GET /resource/sign_up



17
18
19
20
# File 'app/controllers/spree/user_registrations_controller.rb', line 17

def new
  super
  @user = resource
end

#updateObject

PUT /resource



50
51
52
# File 'app/controllers/spree/user_registrations_controller.rb', line 50

def update
  super
end