From fa30e6f23c547abf5020623d1dbbc72dd93ebb26 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Mon, 15 Jan 2018 11:08:07 +0200 Subject: [PATCH] Extract partial --- app/views/admin/domains/_domain.html.erb | 16 ++++++++++++++++ app/views/admin/domains/index.html.erb | 19 +------------------ 2 files changed, 17 insertions(+), 18 deletions(-) create mode 100644 app/views/admin/domains/_domain.html.erb diff --git a/app/views/admin/domains/_domain.html.erb b/app/views/admin/domains/_domain.html.erb new file mode 100644 index 000000000..f0358784e --- /dev/null +++ b/app/views/admin/domains/_domain.html.erb @@ -0,0 +1,16 @@ + + + <%= link_to(domain, admin_domain_path(domain)) %> + + + <% if domain.registrant %> + <%= link_to(domain.registrant, [:admin, domain.registrant]) %> + <% end %> + + + <%= l(domain.valid_to, format: :short) %> + + + <%= link_to(domain.registrar, admin_registrar_path(domain.registrar)) if domain.registrar %> + + diff --git a/app/views/admin/domains/index.html.erb b/app/views/admin/domains/index.html.erb index 39199872e..17b47b4d0 100644 --- a/app/views/admin/domains/index.html.erb +++ b/app/views/admin/domains/index.html.erb @@ -29,24 +29,7 @@ - <% @domains.each do |x| %> - - - <%= link_to(x, admin_domain_path(x)) %> - - - <% if x.registrant %> - <%= link_to(x.registrant, [:admin, x.registrant]) %> - <% end %> - - - <%= l(x.valid_to, format: :short) %> - - - <%= link_to(x.registrar, admin_registrar_path(x.registrar)) if x.registrar %> - - - <% end %> + <%= render @domains %>