Module: MnoEnterprise::Concerns::Controllers::Auth::RegistrationsController
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/mno_enterprise/concerns/controllers/auth/registrations_controller.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#create ⇒ Object
POST /resource.
Instance Method Details
#create ⇒ Object
POST /resource
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/mno_enterprise/concerns/controllers/auth/registrations_controller.rb', line 46 def create build_resource(sign_up_params) resource.password ||= Devise.friendly_token resource_saved = resource.save if resource_saved if resource.active_for_authentication? :notice, :signed_up if is_flashing_format? sign_up(resource_name, resource) yield(:success,resource) if block_given? respond_with resource, location: after_sign_up_path_for(resource) else :notice, :"signed_up_but_#{resource.}" if is_flashing_format? expire_data_after_sign_in! yield(:success_but_inactive,resource) if block_given? respond_with resource, location: after_inactive_sign_up_path_for(resource) end else clean_up_passwords resource @validatable = devise_mapping.validatable? if @validatable @minimum_password_length = resource_class.password_length.min end yield(:error,resource) if block_given? respond_with resource end end |