mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 01:33:36 +02:00
111396946-validates
This commit is contained in:
parent
2ab5d8500a
commit
f31db65d2c
6 changed files with 20 additions and 7 deletions
|
@ -19,7 +19,15 @@ class Admin::BlockedDomainsController < AdminController
|
|||
|
||||
def create
|
||||
|
||||
abort
|
||||
@domain = BlockedDomain.new(blocked_domain_params)
|
||||
|
||||
if @domain.save
|
||||
flash[:notice] = I18n.t('domain_added')
|
||||
redirect_to admin_blocked_domains_path
|
||||
else
|
||||
flash.now[:alert] = I18n.t('failed_to_add_domain')
|
||||
render 'new'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
@ -35,7 +43,7 @@ class Admin::BlockedDomainsController < AdminController
|
|||
end
|
||||
|
||||
|
||||
def blocked_params
|
||||
def blocked_domain_params
|
||||
params.require(:blocked_domain).permit(:name)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue