mirror of
https://github.com/internetee/registry.git
synced 2025-07-29 22:16:19 +02:00
Add missing partial and wildcard search on /admin/reserved_domains
This commit is contained in:
parent
4f96441f26
commit
e588344332
1 changed files with 4 additions and 10 deletions
|
@ -6,7 +6,7 @@ module Admin
|
|||
def index
|
||||
params[:q] ||= {}
|
||||
domains = ReservedDomain.all.order(:name)
|
||||
@q = domains.ransack(params[:q])
|
||||
@q = domains.ransack(PartialSearchFormatter.format(params[:q]))
|
||||
@domains = @q.result.page(params[:page])
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
|
||||
|
@ -17,11 +17,9 @@ module Admin
|
|||
@domain = ReservedDomain.new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
def edit; end
|
||||
|
||||
def create
|
||||
|
||||
@domain = ReservedDomain.new(reserved_domain_params)
|
||||
|
||||
if @domain.save
|
||||
|
@ -31,30 +29,26 @@ module Admin
|
|||
flash.now[:alert] = I18n.t('failed_to_add_domain')
|
||||
render 'new'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
if @domain.update(reserved_domain_params)
|
||||
flash[:notice] = I18n.t('domain_updated')
|
||||
else
|
||||
flash.now[:alert] = I18n.t('failed_to_update_domain')
|
||||
end
|
||||
render 'edit'
|
||||
|
||||
render 'edit'
|
||||
end
|
||||
|
||||
def delete
|
||||
|
||||
if ReservedDomain.find(params[:id]).destroy
|
||||
flash[:notice] = I18n.t('domain_deleted')
|
||||
redirect_to admin_reserved_domains_path
|
||||
else
|
||||
flash.now[:alert] = I18n.t('failed_to_delete_domain')
|
||||
redirect_to admin_reserved_domains_path
|
||||
end
|
||||
|
||||
redirect_to admin_reserved_domains_path
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue