Skip to content
Extraits de code Groupes Projets
registrations_controller.rb 633 octets
Newer Older
  • Learn to ignore specific revisions
  • Raphael's avatar
    Raphael a validé
    #   Copyright (c) 2010, Diaspora Inc.  This file is
    
    Raphael's avatar
    Raphael a validé
    #   licensed under the Affero General Public License version 3 or later.  See
    
    #   the COPYRIGHT file.
    
    class RegistrationsController < Devise::RegistrationsController
      def new
        super
      end
    
      def create
    
          user = User.instantiate!(params[:user])
    
        rescue MongoMapper::DocumentNotValid => e
          user = nil
          flash[:error] = e.message
        end
        if user
    
          flash[:notice] = I18n.t 'registrations.create.success'
    
          sign_in_and_redirect(:user, user)
        else