Class: Users::RegistrationsController
- Inherits:
-
Devise::RegistrationsController
- Object
- Devise::RegistrationsController
- Users::RegistrationsController
- Defined in:
- app/controllers/binda/users/registrations_controller.rb
Instance Method Summary collapse
-
#create {|resource| ... } ⇒ Object
POST /resource.
-
#new ⇒ Object
GET /resource/sign_up.
Instance Method Details
#create {|resource| ... } ⇒ Object
POST /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( sign_up_params ) resource.save yield resource if block_given? if resource.persisted? if resource.active_for_authentication? :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: after_sign_up_path_for(resource) else :notice, :"signed_user_but_#{resource.}" expire_data_after_sign_in! respond_with resource, location: after_inactive_sign_up_path_for(resource) end else clean_up_passwords resource set_minimum_password_length respond_with resource end end |
#new ⇒ Object
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 |