Skip to content

Commit

Permalink
test linked_domain isn't blank prior to linking
Browse files Browse the repository at this point in the history
  • Loading branch information
makyen committed Sep 9, 2019
1 parent e9878cf commit 3895ae7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/domain_links/_link.html.erb
@@ -1,6 +1,6 @@
<div class="domain-link">
<% linked_domain = link.left == domain ? link.right : link.left %>
<strong><%= link_to linked_domain.domain, spam_domain_path(linked_domain) %></strong>
<strong><%= linked_domain.blank? ? 'null domain' : link_to linked_domain.domain, spam_domain_path(linked_domain) %></strong>
<span class="text-muted"><%= link.link_type %></span>
<% if link.comments.present? %>
<a href="#" data-toggle="modal" data-target="#link-modal-<%= link.id %>" class="text-warning">
Expand All @@ -15,7 +15,7 @@
<h4 class="modal-title">Domain Link Details</h4>
</div>
<div class="modal-body">
<p>This domain (<%= domain.domain %>) is linked to <strong><%= link_to linked_domain.domain, spam_domain_path(linked_domain) %></strong>
<p>This domain (<%= domain.domain %>) is linked to <strong><%= linked_domain.blank? ? 'null domain' : link_to linked_domain.domain, spam_domain_path(linked_domain) %></strong>
<span class="text-muted">(<%= link.link_type %>)</span>.</p>
<p>Linked by <strong><%= link.creator.username %></strong> <%= time_ago_in_words(link.created_at) %> ago, with these comments:</p>
<blockquote><%= link.comments %></blockquote>
Expand Down

0 comments on commit 3895ae7

Please sign in to comment.