diff --git a/app/controllers/registrant/domains_controller.rb b/app/controllers/registrant/domains_controller.rb index 6580b1c..116ece8 100644 --- a/app/controllers/registrant/domains_controller.rb +++ b/app/controllers/registrant/domains_controller.rb @@ -18,6 +18,8 @@ def new end Tld::Estonian::MIN_NAMESERVER_COUNT.times do |i| + next if Setting.default_nameserver_records[i].blank? + current_nameserver = JSON.parse(Setting.default_nameserver_records[i]) @domain.nameservers.build( hostname: current_nameserver['hostname'], diff --git a/app/views/registrant/domains/_form.html.erb b/app/views/registrant/domains/_form.html.erb index 9bd9a16..ba1827f 100644 --- a/app/views/registrant/domains/_form.html.erb +++ b/app/views/registrant/domains/_form.html.erb @@ -9,9 +9,15 @@
Price list
- <% DomainPrice.all.each do |price| %> - <%= form.radio_button :domain_price, price.id, checked: DomainPrice.first == price ? true : false %> <%= price.price %> - <%= price.duration / 1.month %> months
+ + <% if DomainPrice.all.any? %> + <% DomainPrice.all.each do |price| %> + <%= form.radio_button :domain_price, price.id, checked: DomainPrice.first == price ? true : false %> <%= price.price %> - <%= price.duration / 1.month %> months
+ <% end %> + <% else %> + <%= t('.no_price_lists') %> <% end %> +
<%= component 'divider', label: t('.optional') %>