mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Validate e-mail when country is other than estonia
This commit is contained in:
parent
0dc0cc63d9
commit
42b1890bf5
4 changed files with 20 additions and 4 deletions
|
@ -14,10 +14,10 @@ class Admin::UsersController < AdminController
|
|||
@user = User.new(user_params)
|
||||
|
||||
if @user.save
|
||||
flash[:notice] = I18n.t('shared.user_added')
|
||||
flash[:notice] = I18n.t('shared.record_created')
|
||||
redirect_to [:admin, @user]
|
||||
else
|
||||
flash.now[:alert] = I18n.t('shared.failed_to_add_user')
|
||||
flash.now[:alert] = I18n.t('shared.failed_to_create_record')
|
||||
render 'new'
|
||||
end
|
||||
end
|
||||
|
@ -36,6 +36,16 @@ class Admin::UsersController < AdminController
|
|||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
if @user.destroy
|
||||
flash[:notice] = I18n.t('shared.record_deleted')
|
||||
redirect_to admin_users_path
|
||||
else
|
||||
flash.now[:alert] = I18n.t('shared.failed_to_delete_record')
|
||||
render 'show'
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_user
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue