Newer
Older
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
class RegistrationsController < Devise::RegistrationsController
def create
Jamie Wilkinson
a validé
begin
@user = User.instantiate!(params[:user])
rescue MongoMapper::DocumentNotValid => e
flash[:error] = e.message
redirect_to new_user_registration_path
flash[:notice] = I18n.t 'registrations.create.success'
sign_in_and_redirect(:user, @user)
flash[:error] = @user.errors.full_messages.join(', ')
Jamie Wilkinson
a validé
redirect_to new_user_registration_path