Class: Users::RegistrationsController

Inherits:
Devise::RegistrationsController
  • Object
show all
Defined in:
app/controllers/binda/users/registrations_controller.rb

Instance Method Summary collapse

Instance Method Details

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

POST /resource

Yields:

  • (resource)


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/controllers/binda/users/registrations_controller.rb', line 20

def create
  build_resource(  )

  resource.save
  yield resource if block_given?
  if resource.persisted?
    if resource.active_for_authentication?
      set_flash_message! :notice, :signed_user
      # The following is commented out so the user remains the current, not the one just created
      # sign_up(resource_name, resource)
      respond_with resource, location: (resource)
    else
      set_flash_message! :notice, :"signed_user_but_#{resource.inactive_message}"
      expire_data_after_sign_in!
      respond_with resource, location: (resource)
    end
  else
    clean_up_passwords resource
    set_minimum_password_length
    respond_with resource
  end
end

#newObject

GET /resource/sign_up



11
12
13
14
15
16
17
# File 'app/controllers/binda/users/registrations_controller.rb', line 11

def new
  if user_signed_in?
    super
  else
    redirect_to settings_path
  end
end