app/controllers/application_controller.rb
# Devise "lazy" parameter sanitizer.
#
Devise "lazy" parameter sanitizer.
Devise " lazy " parameter sanitizer .
def configure_devise_permitted_parameters
    if (params[:controller].to_s == 'devise/registrations') &&
       ( (params[:action].to_s == 'new') || (params[:action].to_s == 'create') )
      if (params[:action].to_s == 'new') || (params[:action].to_s == 'create' && verify_recaptcha)
        devise_parameter_sanitizer.permit(:sign_up) do |user_params|
          user_params.permit(
            :email, :password, :password_confirmation,
            :name, :first_name, :last_name, :description, :year_of_birth
          )
        end
        flash[:error] = nil
      else
        flash[:error] = I18n.t('search_view.captcha_fail')
      end
    end
    devise_parameter_sanitizer.permit(:account_update) do |user_params|
      user_params.permit(
        :email, :password, :password_confirmation,
        :name, :first_name, :last_name, :description, :year_of_birth
      )
    end
  end
def configure_devise_permitted_parameters if ( params [ :controller ] . to_s == 'devise/registrations' ) && ( ( params [ :action ] . to_s == 'new' ) || ( params [ :action ] . to_s == 'create' ) ) if ( params [ :action ] . to_s == 'new' ) || ( params [ :action ] . to_s == 'create' && verify_recaptcha ) devise_parameter_sanitizer . permit ( :sign_up ) do | user_params | user_params . permit ( :email , :password , :password_confirmation , :name , :first_name , :last_name , :description , :year_of_birth ) end flash [ :error ] = nil else flash [ :error ] = I18n . t ( 'search_view.captcha_fail' ) end end devise_parameter_sanitizer . permit ( :account_update ) do | user_params | user_params . permit ( :email , :password , :password_confirmation , :name , :first_name , :last_name , :description , :year_of_birth ) end end
Devise "lazy" parameter sanitizer.
Devise " lazy " parameter sanitizer .
# We can't easily override here the internal Devise::RegistrionController used by the # Engine, because the engine is not namespaced. # So we have to resort to some tinkering right here: # DEBUG #    logger.debug( "\r\n\r\n!! =====[ #{self.class.name}: configure_devise_permitted_parameters ]====" ) #    logger.debug( "- resource...: " << resource.inspect ) #    logger.debug( "- PARAMS.....: " << params.inspect ) #    logger.debug( "- CTRL.......: " << params[:controller] ) #    logger.debug( "- ACTION.....: " << params[:action] ) # User new/create: do not allow any parameter if recaptcha fails: #      logger.debug( "In devise/registrations..." ) # User edit/update: