Pagination for domains

This commit is contained in:
Martin Lensment 2014-09-05 12:50:46 +03:00
parent 8531e50474
commit 11319b6f36
6 changed files with 29 additions and 2 deletions

View file

@ -1,5 +1,5 @@
class Admin::DomainsController < ApplicationController
def index
@domains = Domain.all
@domains = Domain.order(:name).page(params[:page])
end
end

View file

@ -3,7 +3,6 @@ class Domain < ActiveRecord::Base
# TODO most inputs should be trimmed before validatation, probably some global logic?
include EppErrors
EPP_ATTR_MAP = {
owner_contact: 'registrant',
name_dirty: 'name',

View file

@ -22,3 +22,6 @@
%td= link_to(x.owner_contact, root_path)
%td= l(x.valid_to, format: :short)
%td= link_to(t('shared.edit'), edit_admin_domain_path(x), class: 'btn btn-primary btn-xs')
.row
.col-md-12
= paginate @domains