Class: DeviseExtensions::RegistrationsController
- Inherits:
-
Devise::RegistrationsController
- Object
- Devise::RegistrationsController
- DeviseExtensions::RegistrationsController
- Defined in:
- app/controllers/devise_extensions/registrations_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /resource.
-
#new ⇒ Object
GET /resource/sign_up.
Instance Method Details
#create ⇒ Object
POST /resource
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/devise_extensions/registrations_controller.rb', line 12 def create build_resource(params[:user]) captcha_verified = if Rails.env == 'production' verify_recaptcha(model: resource, message: I18n.t('general.exceptions.wrong_recaptcha')) else true end if captcha_verified && resource.save if resource.active_for_authentication? :notice, :signed_up if sign_in(resource_name, resource) respond_with resource, :location => after_sign_up_path_for(resource) else :notice, :"signed_up_but_#{resource.}" if expire_session_data_after_sign_in! respond_with resource, :location => after_inactive_sign_up_path_for(resource) end else @presenter = Resources::User::FormPresenter.new(self.view_context, resource: resource) clean_up_passwords resource respond_with resource end end |
#new ⇒ Object
GET /resource/sign_up
3 4 5 6 7 8 9 |
# File 'app/controllers/devise_extensions/registrations_controller.rb', line 3 def new resource = build_resource({}) @presenter = Resources::User::FormPresenter.new(self.view_context, resource: resource) respond_with resource end |