Class: Devise::RegistrationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Devise::RegistrationsController
- Includes:
- Controllers::InternalHelpers
- Defined in:
- app/controllers/devise/registrations_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /resource/sign_up.
-
#destroy ⇒ Object
DELETE /resource.
-
#edit ⇒ Object
GET /resource/edit.
-
#new ⇒ Object
GET /resource/sign_up.
-
#update ⇒ Object
PUT /resource.
Methods included from Controllers::InternalHelpers
#devise_controller?, #devise_mapping, #resource, #resource_class, #resource_name
Instance Method Details
#create ⇒ Object
POST /resource/sign_up
13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/devise/registrations_controller.rb', line 13 def create build_resource if resource.save :notice, :signed_up sign_in_and_redirect(resource_name, resource) else clean_up_passwords(resource) render_with_scope :new end end |
#destroy ⇒ Object
DELETE /resource
42 43 44 45 46 |
# File 'app/controllers/devise/registrations_controller.rb', line 42 def destroy resource.destroy :notice, :destroyed sign_out_and_redirect(self.resource) end |
#edit ⇒ Object
GET /resource/edit
26 27 28 |
# File 'app/controllers/devise/registrations_controller.rb', line 26 def edit render_with_scope :edit end |
#new ⇒ Object
GET /resource/sign_up
7 8 9 10 |
# File 'app/controllers/devise/registrations_controller.rb', line 7 def new build_resource({}) render_with_scope :new end |
#update ⇒ Object
PUT /resource
31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/devise/registrations_controller.rb', line 31 def update if resource.update_with_password(params[resource_name]) :notice, :updated redirect_to after_update_path_for(resource) else clean_up_passwords(resource) render_with_scope :edit end end |