Class: Devise::RegistrationsController

Inherits:
DeviseController
  • Object
show all
Defined in:
app/controllers/integrator/devise/registrations_controller.rb

Instance Method Summary collapse

Instance Method Details

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

Yields:

  • (resource)


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/integrator/devise/registrations_controller.rb', line 13

def create
  build_resource()
  resource.save
  yield resource if block_given?

  if resource.persisted?
    set_flash_message! :notice, :signed_up
    (resource_name, resource)
    respond_with resource, location: root_path
  else
    clean_up_passwords resource
    set_minimum_password_length
    respond_with resource
  end
end

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

Yields:

  • (resource)


7
8
9
10
11
# File 'app/controllers/integrator/devise/registrations_controller.rb', line 7

def new
  build_resource({})
  yield resource if block_given?
  respond_with resource
end